test(sp39): bump PRAGMA user_version assertion from 20 to 21
Migration 0021_resubmissions.sql (SP39 Task 2) advances the head from 20 to 21. Both test_migration_0020.migrated_engine and test_acks.test_migration_latest_idempotent_on_fresh_db pinned the old head; update both. No production behavior change.
This commit is contained in:
@@ -51,7 +51,7 @@ def test_migration_0002_creates_acks_table():
|
|||||||
|
|
||||||
def test_migration_latest_idempotent_on_fresh_db():
|
def test_migration_latest_idempotent_on_fresh_db():
|
||||||
"""Re-running the migration on the same DB must be a no-op (PRAGMA
|
"""Re-running the migration on the same DB must be a no-op (PRAGMA
|
||||||
user_version already at the latest version — currently 20 after
|
user_version already at the latest version — currently 21 after
|
||||||
0004-0006 line_reconciliation, 0005 ta1_acks, SP9's 0007
|
0004-0006 line_reconciliation, 0005 ta1_acks, SP9's 0007
|
||||||
providers/payers/clearhouse, SP10's 0008 payer_rejected,
|
providers/payers/clearhouse, SP10's 0008 payer_rejected,
|
||||||
SP11's 0009 audit_log, SP14's 0010 payer_rejected_acknowledged,
|
SP11's 0009 audit_log, SP14's 0010 payer_rejected_acknowledged,
|
||||||
@@ -61,16 +61,17 @@ def test_migration_latest_idempotent_on_fresh_db():
|
|||||||
claims.matched_remittance_id index, SP27-Task 17's 0017
|
claims.matched_remittance_id index, SP27-Task 17's 0017
|
||||||
claim.patient_control_number backfill UPDATE, SP28's 0018
|
claim.patient_control_number backfill UPDATE, SP28's 0018
|
||||||
claim_acks join table, SP32's 0019
|
claim_acks join table, SP32's 0019
|
||||||
rendering_provider_npi + service_provider_npi, and SP37's 0020
|
rendering_provider_npi + service_provider_npi, SP37's 0020
|
||||||
transaction_set_control_number)."""
|
transaction_set_control_number, and SP39's 0021 resubmissions
|
||||||
|
audit table)."""
|
||||||
with db.engine().begin() as c:
|
with db.engine().begin() as c:
|
||||||
v1 = c.exec_driver_sql("PRAGMA user_version").scalar() or 0
|
v1 = c.exec_driver_sql("PRAGMA user_version").scalar() or 0
|
||||||
assert v1 == 20
|
assert v1 == 21
|
||||||
# A second run should not raise and should not bump the version.
|
# A second run should not raise and should not bump the version.
|
||||||
db_migrate.run(db.engine())
|
db_migrate.run(db.engine())
|
||||||
with db.engine().begin() as c:
|
with db.engine().begin() as c:
|
||||||
v2 = c.exec_driver_sql("PRAGMA user_version").scalar() or 0
|
v2 = c.exec_driver_sql("PRAGMA user_version").scalar() or 0
|
||||||
assert v2 == 20
|
assert v2 == 21
|
||||||
|
|
||||||
|
|
||||||
def test_add_ack_persists_row():
|
def test_add_ack_persists_row():
|
||||||
|
|||||||
@@ -102,10 +102,10 @@ def migrated_engine(tmp_path: Path, monkeypatch: pytest.MonkeyPatch):
|
|||||||
engine = _fresh_engine(tmp_path / "mig0020.db")
|
engine = _fresh_engine(tmp_path / "mig0020.db")
|
||||||
db_migrate.run(engine)
|
db_migrate.run(engine)
|
||||||
|
|
||||||
# Confirm head is 20 (every migration applied).
|
# Confirm head is 21 (every migration applied, including SP39's 0021).
|
||||||
with engine.connect() as conn:
|
with engine.connect() as conn:
|
||||||
v = conn.exec_driver_sql("PRAGMA user_version").scalar() or 0
|
v = conn.exec_driver_sql("PRAGMA user_version").scalar() or 0
|
||||||
assert v == 20, f"expected migration head=20, got {v}"
|
assert v == 21, f"expected migration head=21, got {v}"
|
||||||
|
|
||||||
yield engine
|
yield engine
|
||||||
engine.dispose()
|
engine.dispose()
|
||||||
|
|||||||
Reference in New Issue
Block a user