Introduce migrations folder + improve README.md + add custom CDN for Material Icons
This commit is contained in:
parent
b09d32d5e8
commit
e449e06b5d
5 changed files with 44 additions and 4 deletions
17
migrations/0_6to0_7.py
Normal file
17
migrations/0_6to0_7.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
from playhouse.migrate import migrate, SqliteMigrator, MySQLMigrator
|
||||
from peewee import MySQLDatabase, SqliteDatabase
|
||||
from app import database
|
||||
|
||||
if type(database) == MySQLDatabase:
|
||||
migrator = MySQLMigrator(database)
|
||||
elif type(database) == SqliteDatabase:
|
||||
migrator = SqliteMigrator(database)
|
||||
else:
|
||||
print("Unsupported database")
|
||||
exit()
|
||||
|
||||
with database.atomic():
|
||||
migrate(
|
||||
|
||||
)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue