diff options
author | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2012-06-14 21:57:24 +0200 |
---|---|---|
committer | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2012-06-14 21:57:24 +0200 |
commit | b105540141ce3557456059b0e5dd5e589063e2f3 (patch) | |
tree | 5f1edaf7ea848e660aef4ef141c707d9684fc8f9 /mediagoblin | |
parent | 4ba4e27b4430f6f3ad5b75a209688830dea2bbf1 (diff) | |
download | mediagoblin-b105540141ce3557456059b0e5dd5e589063e2f3.tar.lz mediagoblin-b105540141ce3557456059b0e5dd5e589063e2f3.tar.xz mediagoblin-b105540141ce3557456059b0e5dd5e589063e2f3.zip |
First migration fix: commit after each migration.
sqlite doesn't like complex changes (alter table) to happen
inside a transaction that has already done other things.
And really, each migration should say "I'm done" and commit
its changes.
This is not the full story, but it's the core of it.
Specifially the migration framework should probably do a
rollback "just in case" after each migration.
Diffstat (limited to 'mediagoblin')
-rw-r--r-- | mediagoblin/db/sql/migrations.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/mediagoblin/db/sql/migrations.py b/mediagoblin/db/sql/migrations.py index 453801a5..d6b709b2 100644 --- a/mediagoblin/db/sql/migrations.py +++ b/mediagoblin/db/sql/migrations.py @@ -33,6 +33,7 @@ def ogg_to_webm_audio(db_conn): file_keynames.update().where(file_keynames.c.name == 'ogg'). values(name='webm_audio') ) + db_conn.commit() @RegisterMigration(2, MIGRATIONS) @@ -45,3 +46,4 @@ def add_wants_notification_column(db_conn): col = Column('wants_comment_notification', Boolean, default=True, nullable=True) col.create(users, populate_defaults=True) + db_conn.commit() |