SubscribeStar .art age fix, modal tag-flow sync, system tags / training hygiene (#128) #190

Merged
bvandeusen merged 9 commits from dev into main 2026-07-03 09:16:16 -04:00
Showing only changes of commit 19744fa41d - Show all commits
+11
View File
@@ -166,6 +166,17 @@ def _reset_db_after_integration(request, _truncate_engine):
rows = (_SEED_SNAPSHOT or {}).get(t.name)
if rows:
conn.execute(t.insert(), rows)
# Restored rows carry their explicit ids while RESTART
# IDENTITY reset the sequence to 1, so the next ORM insert
# would collide on the PK (bitten by migration 0075's seeded
# system tags: every Tag insert failed with pk_tag id=1).
# Resync any serial id sequence past the restored rows.
if "id" in t.c:
conn.exec_driver_sql(
f"SELECT setval(pg_get_serial_sequence('{t.name}', 'id'), "
f"(SELECT COALESCE(MAX(id), 1) FROM {t.name})) "
f"WHERE pg_get_serial_sequence('{t.name}', 'id') IS NOT NULL"
)
@pytest_asyncio.fixture(autouse=True)