diff options
author | Joar Wandborg <git@wandborg.com> | 2012-06-10 18:31:49 +0200 |
---|---|---|
committer | Joar Wandborg <git@wandborg.com> | 2012-06-10 18:31:49 +0200 |
commit | c4869eff408116d9082c6b0536980d3aa71c1172 (patch) | |
tree | 37f22ec13799f9bf86ea26756f09cec26ab40776 | |
parent | 38c6d44123aa1ee21e55730cc13f9e3da30a94f4 (diff) | |
download | mediagoblin-c4869eff408116d9082c6b0536980d3aa71c1172.tar.lz mediagoblin-c4869eff408116d9082c6b0536980d3aa71c1172.tar.xz mediagoblin-c4869eff408116d9082c6b0536980d3aa71c1172.zip |
FIXED SQL MIGRATION #2
-rw-r--r-- | mediagoblin/db/sql/migrations.py | 2 | ||||
-rw-r--r-- | mediagoblin/db/sql/models.py | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/mediagoblin/db/sql/migrations.py b/mediagoblin/db/sql/migrations.py index c7f45e16..453801a5 100644 --- a/mediagoblin/db/sql/migrations.py +++ b/mediagoblin/db/sql/migrations.py @@ -43,5 +43,5 @@ def add_wants_notification_column(db_conn): autoload_with=db_conn.bind) col = Column('wants_comment_notification', Boolean, - default=True, nullable=False) + default=True, nullable=True) col.create(users, populate_defaults=True) diff --git a/mediagoblin/db/sql/models.py b/mediagoblin/db/sql/models.py index ba28ab7b..d17386fc 100644 --- a/mediagoblin/db/sql/models.py +++ b/mediagoblin/db/sql/models.py @@ -38,7 +38,7 @@ from mediagoblin.db.sql.base import Session # It's actually kind of annoying how sqlalchemy-migrate does this, if # I understand it right, but whatever. Anyway, don't remove this :P -# +# # We could do migration calls more manually instead of relying on # this import-based meddling... from migrate import changeset @@ -70,7 +70,9 @@ class User(Base, UserMixin): pw_hash = Column(Unicode, nullable=False) email_verified = Column(Boolean, default=False) status = Column(Unicode, default=u"needs_email_verification", nullable=False) - wants_comment_notification = Column(Boolean, default=True, nullable=False) + # Intented to be nullable=False, but migrations would not work for it + # set to nullable=True implicitly. + wants_comment_notification = Column(Boolean, default=True) verification_key = Column(Unicode) is_admin = Column(Boolean, default=False, nullable=False) url = Column(Unicode) |