This update changes migrations to wrap db.execute results in a list to
keep the connection from closing for sqlite migrations.
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,
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,