Explain about sqlite dropping the constraint and why we're adding it back manually.
authorChristopher Allan Webber <cwebber@dustycloud.org>
Tue, 25 Jun 2013 22:12:33 +0000 (17:12 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Tue, 25 Jun 2013 22:12:33 +0000 (17:12 -0500)
mediagoblin/db/migrations.py

index fef353af5d507674d1366c7bc1dfa5cd8c0aa272..98e8b139bcc3900ade11168fa4da32c4868e7d27 100644 (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()