diff options
author | Rodney Ewing <ewing.rj@gmail.com> | 2013-08-08 15:07:07 -0700 |
---|---|---|
committer | Rodney Ewing <ewing.rj@gmail.com> | 2013-08-20 08:10:50 -0700 |
commit | 93d805ad6b0e5324c515323d2fc0a4a7ea3f1dad (patch) | |
tree | ef393bce2e8f8d6cc587225a7c5733c125c9a914 /mediagoblin/db/migrations.py | |
parent | 4a2aa93c6abeb4831a03a9e8bd7089d0a6f2470e (diff) | |
download | mediagoblin-93d805ad6b0e5324c515323d2fc0a4a7ea3f1dad.tar.lz mediagoblin-93d805ad6b0e5324c515323d2fc0a4a7ea3f1dad.tar.xz mediagoblin-93d805ad6b0e5324c515323d2fc0a4a7ea3f1dad.zip |
add user prefrence for insite notifications
Diffstat (limited to 'mediagoblin/db/migrations.py')
-rw-r--r-- | mediagoblin/db/migrations.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/mediagoblin/db/migrations.py b/mediagoblin/db/migrations.py index 374ab4c8..d542d7b9 100644 --- a/mediagoblin/db/migrations.py +++ b/mediagoblin/db/migrations.py @@ -425,7 +425,7 @@ class RequestToken_v0(declarative_base()): callback = Column(Unicode, nullable=False, default=u"oob") created = Column(DateTime, nullable=False, default=datetime.datetime.now) updated = Column(DateTime, nullable=False, default=datetime.datetime.now) - + class AccessToken_v0(declarative_base()): """ Model for representing the access tokens @@ -438,7 +438,7 @@ class AccessToken_v0(declarative_base()): request_token = Column(Unicode, ForeignKey(RequestToken_v0.token)) created = Column(DateTime, nullable=False, default=datetime.datetime.now) updated = Column(DateTime, nullable=False, default=datetime.datetime.now) - + class NonceTimestamp_v0(declarative_base()): """ @@ -460,3 +460,15 @@ def create_oauth1_tables(db): NonceTimestamp_v0.__table__.create(db.bind) db.commit() + + +@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() |