Fix issue #5411 sqlite connection closes
This update changes migrations to wrap db.execute results in a list to keep the connection from closing for sqlite migrations.
This commit is contained in:
parent
5aa4ab0615
commit
1fe6f5d6d7
@ -32,7 +32,8 @@ def upgrade():
|
||||
collection_items_table = inspect_table(metadata, "core__collection_items")
|
||||
graveyard_table = inspect_table(metadata, "core__graveyard")
|
||||
|
||||
for tombstone in db.execute(graveyard_table.select()):
|
||||
res = list(db.execute(graveyard_table.select()))
|
||||
for tombstone in res:
|
||||
# Get GMR for tombstone
|
||||
gmr = db.execute(gmr_table.select().where(and_(
|
||||
gmr_table.c.obj_pk == tombstone.id,
|
||||
|
@ -28,7 +28,8 @@ def upgrade():
|
||||
graveyard_table = inspect_table(metadata, "core__graveyard")
|
||||
gmr_table = inspect_table(metadata, "core__generic_model_reference")
|
||||
|
||||
for tombstone in db.execute(gmr_table.select()):
|
||||
res = list(db.execute(gmr_table.select()))
|
||||
for tombstone in res:
|
||||
# Look up the gmr for the tombstone8
|
||||
gmr = db.execute(gmr_table.select().where(and_(
|
||||
gmr_table.c.obj_pk == tombstone.id,
|
||||
|
Loading…
x
Reference in New Issue
Block a user