fix: preserve schema 15 compatibility for v0.1.8
This commit is contained in:
@@ -51,7 +51,7 @@ def test_same_version_existing_db_upgrade_is_idempotent_and_preserves_rows(tmp_p
|
||||
assert conn.execute("SELECT name, sql FROM sqlite_master WHERE type IN ('table', 'index') AND name NOT LIKE 'monthly_settlement%' AND name <> 'sqlite_sequence' ORDER BY name").fetchall() == before_tables
|
||||
|
||||
|
||||
def test_schema16_db_missing_field_gets_only_targeted_additive_column(tmp_path):
|
||||
def test_schema15_db_missing_field_gets_only_targeted_additive_column(tmp_path):
|
||||
path = str(tmp_path / "legacy16.sqlite3")
|
||||
init_db(path)
|
||||
with sqlite3.connect(path) as conn:
|
||||
@@ -69,7 +69,7 @@ def test_schema16_db_missing_field_gets_only_targeted_additive_column(tmp_path):
|
||||
)
|
||||
conn.execute("INSERT INTO monthly_settlement SELECT id,month,basis_date,status,version,memo,created_by,created_at,updated_by,updated_at,reviewed_by,reviewed_at,review_fingerprint,approved_by,approved_at,approved_version,approved_fingerprint,approval_reason,approval_flags_json,closed_by,closed_at,cancelled_by,cancelled_at,cancellation_reason FROM monthly_settlement_without_fingerprint")
|
||||
conn.execute("DROP TABLE monthly_settlement_without_fingerprint")
|
||||
conn.execute("INSERT INTO schema_meta(key,value) VALUES('schema_version','16') ON CONFLICT(key) DO UPDATE SET value='16'")
|
||||
conn.execute("INSERT INTO schema_meta(key,value) VALUES('schema_version','15') ON CONFLICT(key) DO UPDATE SET value='15'")
|
||||
conn.execute(
|
||||
"INSERT INTO monthly_settlement(id,month,basis_date,status,version,created_by,created_at,updated_by,updated_at) "
|
||||
"VALUES ('m1','2026-10','2026-10-31','draft',1,'u','t','u','t')"
|
||||
|
||||
Reference in New Issue
Block a user