diff options
author | Rodney Ewing <ewing.rj@gmail.com> | 2013-05-13 15:49:50 -0700 |
---|---|---|
committer | Rodney Ewing <ewing.rj@gmail.com> | 2013-05-24 16:52:48 -0700 |
commit | b56b6b1e77cc01aa1ebebd1c6c594ec79cb4d8c1 (patch) | |
tree | a7d71510b17fa7407c428a483b73ad6820162901 | |
parent | 0f3504e35b823f7ab391261e6d9a999bcf655d03 (diff) | |
download | mediagoblin-b56b6b1e77cc01aa1ebebd1c6c594ec79cb4d8c1.tar.lz mediagoblin-b56b6b1e77cc01aa1ebebd1c6c594ec79cb4d8c1.tar.xz mediagoblin-b56b6b1e77cc01aa1ebebd1c6c594ec79cb4d8c1.zip |
changed User model pw_hash field to nullable and added migrations
-rw-r--r-- | mediagoblin/db/migrations.py | 9 | ||||
-rw-r--r-- | mediagoblin/db/models.py | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/mediagoblin/db/migrations.py b/mediagoblin/db/migrations.py index 2c553396..1617db48 100644 --- a/mediagoblin/db/migrations.py +++ b/mediagoblin/db/migrations.py @@ -287,3 +287,12 @@ def unique_collections_slug(db): constraint.create() db.commit() + + +@RegisterMigration(11, MIGRATIONS) +def pw_hash_nullable(db): + """Make pw_hash column nullable""" + metadata = MetaData(bind=db.bind) + user_table = inspect_table(metadata, "core__users") + + user_table.c.pw_hash.alter(nullable=True) diff --git a/mediagoblin/db/models.py b/mediagoblin/db/models.py index 2b925983..323ed4d7 100644 --- a/mediagoblin/db/models.py +++ b/mediagoblin/db/models.py @@ -61,7 +61,7 @@ class User(Base, UserMixin): # point. email = Column(Unicode, nullable=False) created = Column(DateTime, nullable=False, default=datetime.datetime.now) - pw_hash = Column(Unicode, nullable=False) + pw_hash = Column(Unicode) email_verified = Column(Boolean, default=False) status = Column(Unicode, default=u"needs_email_verification", nullable=False) # Intented to be nullable=False, but migrations would not work for it |