Explain about sqlite dropping the constraint and why we're adding it back manually.

This commit is contained in:
Christopher Allan Webber 2013-06-25 17:12:33 -05:00
parent 6174169786
commit 15db183151

View File

@ -371,6 +371,8 @@ def pw_hash_nullable(db):
user_table.c.pw_hash.alter(nullable=True)
# sqlite+sqlalchemy seems to drop this constraint during the
# migration, so we add it back here for now a bit manually.
if db.bind.url.drivername == 'sqlite':
constraint = UniqueConstraint('username', table=user_table)
constraint.create()