From: Christopher Allan Webber Date: Tue, 25 Jun 2013 22:12:33 +0000 (-0500) Subject: Explain about sqlite dropping the constraint and why we're adding it back manually. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=15db1831514aeb9fd77b7bf43a2718b1ffc4d552;p=mediagoblin.git Explain about sqlite dropping the constraint and why we're adding it back manually. --- diff --git a/mediagoblin/db/migrations.py b/mediagoblin/db/migrations.py index fef353af..98e8b139 100644 --- a/mediagoblin/db/migrations.py +++ b/mediagoblin/db/migrations.py @@ -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()