Skip to content

Commit

Permalink
Close the cursor for SQLite for 034 upgrade/downgrade on select
Browse files Browse the repository at this point in the history
The list() is needed around the table select for SQLite upgrade/downgrade
to work.  This forces a cursor close and prevents database locked errors.

closes-bug: 1233329
Change-Id: I01aedf9d2743a86881c124c9690f10233d9966bc
  • Loading branch information
Morgan Fainberg authored and dolph committed Oct 8, 2013
1 parent b6b1e30 commit d044f0b
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -23,7 +23,7 @@
def migrate_default_project_from_extra_json(meta, migrate_engine):
user_table = sql.Table('user', meta, autoload=True)

user_list = user_table.select().execute()
user_list = list(user_table.select().execute())
session = sessionmaker(bind=migrate_engine)()
for user in user_list:
try:
Expand Down Expand Up @@ -58,7 +58,7 @@ def migrate_default_project_from_extra_json(meta, migrate_engine):
def migrate_default_project_to_extra_json(meta, migrate_engine):
user_table = sql.Table('user', meta, autoload=True)

user_list = user_table.select().execute()
user_list = list(user_table.select().execute())
session = sessionmaker(bind=migrate_engine)()
for user in user_list:
try:
Expand Down

0 comments on commit d044f0b

Please sign in to comment.