diff options
Diffstat (limited to 'mediagoblin/db/migrations.py')
-rw-r--r-- | mediagoblin/db/migrations.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/mediagoblin/db/migrations.py b/mediagoblin/db/migrations.py index b3dca72c..e2a0bf26 100644 --- a/mediagoblin/db/migrations.py +++ b/mediagoblin/db/migrations.py @@ -365,6 +365,8 @@ def add_new_notification_tables(db): CommentNotification_v0.__table__.create(db.bind) ProcessingNotification_v0.__table__.create(db.bind) + db.commit() + @RegisterMigration(13, MIGRATIONS) def pw_hash_nullable(db): @@ -463,6 +465,18 @@ def create_oauth1_tables(db): @RegisterMigration(15, MIGRATIONS) +def wants_notifications(db): + """Add a wants_notifications field to User model""" + metadata = MetaData(bind=db.bind) + user_table = inspect_table(metadata, "core__users") + + col = Column('wants_notifications', Boolean, default=True) + col.create(user_table) + + db.commit() + + +@RegisterMigration(16, MIGRATIONS) def upload_limits(db): """Add user upload limit columns""" metadata = MetaData(bind=db.bind) |