Schema changes + introducing CSRF. You have to run python3 -m migrations.0_6to0_7 to continue using
This commit is contained in:
parent
e449e06b5d
commit
0b5286fb8a
3 changed files with 40 additions and 59 deletions
|
|
@ -1,6 +1,7 @@
|
|||
from playhouse.migrate import migrate, SqliteMigrator, MySQLMigrator
|
||||
from peewee import MySQLDatabase, SqliteDatabase
|
||||
from app import database
|
||||
from peewee import MySQLDatabase, SqliteDatabase, \
|
||||
IntegerField, DateTimeField, ForeignKeyField
|
||||
from app import database, User
|
||||
|
||||
if type(database) == MySQLDatabase:
|
||||
migrator = MySQLMigrator(database)
|
||||
|
|
@ -11,7 +12,9 @@ else:
|
|||
exit()
|
||||
|
||||
with database.atomic():
|
||||
database.create_tables([User])
|
||||
migrate(
|
||||
|
||||
migrator.add_column('page', 'calendar', DateTimeField(index=True, null=True)),
|
||||
migrator.add_column('page', 'owner_id', IntegerField(null=True))
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue