fix: preserve schema 15 compatibility for v0.1.8
This commit is contained in:
@@ -174,7 +174,7 @@ def test_settlement_draft_runtime_cancel_and_recovery_contract() -> None:
|
||||
for clause in ("cancel_settlement_draft(draft_id, expected_version, cancelled_by, reason, db_path=None)",
|
||||
"active", "nonempty", "cancelled_by", "cancellation_reason", "cancelled_at",
|
||||
"approval_fingerprint", "approval_version", "version", "updated_at", "BEGIN IMMEDIATE",
|
||||
"retained", "account_valuations", "asset_snapshot_runs", "account_snapshot",
|
||||
"retained", "account_valuations", "asset_snapshot_runs", "asset_snapshots",
|
||||
"rollback", "no-write", "completed", "cancelled", "fresh create key",
|
||||
"same create key", "latest prior run", "correction_of_run_id", "correction_reason",
|
||||
"tests/test_settlement_draft_correction_contract.py"):
|
||||
@@ -207,7 +207,7 @@ def test_settlement_cashflow_model_documents_schema_and_legacy_reproduction(tmp_
|
||||
names = {
|
||||
"asset_snapshot_runs": ("settlement_month", "currency", "income_total", "expense_total", "net_cashflow", "total_assets", "total_liabilities", "net_worth", "cashflow_policy_json", "aggregation_version", "snapshot_schema_version", "source_snapshot_json"),
|
||||
"settlement_drafts": ("cashflow_policy_json", "aggregation_version"),
|
||||
"settlement_cashflow_snapshots": ("id", "settlement_run_id", "cashflow_kind", "category", "subcategory", "amount", "transaction_count", "currency"),
|
||||
"settlement_cashflow_snapshots": ("id", "monthly_settlement_id", "settlement_run_id", "cashflow_kind", "category", "subcategory", "amount", "transaction_count", "currency"),
|
||||
}
|
||||
database = tmp_path / "synthetic-doc-schema.sqlite3"
|
||||
init_db(str(database))
|
||||
@@ -220,7 +220,12 @@ def test_settlement_cashflow_model_documents_schema_and_legacy_reproduction(tmp_
|
||||
reproduction = _comprehensive_section(doc, "### Comprehensive snapshot evidence inputs")
|
||||
for field in ("source_snapshot_json", "transactions", "assets", "transaction_date", "originalcashflow_kind", "applied_amount", "valuation_id", "valuation_date", "authority_source", "cashflow_policy_json", "legacy", "NULL"):
|
||||
assert field in reproduction, field
|
||||
for constraint in ("ON DELETE RESTRICT", "UNIQUE", "transaction_count > 0", "idx_settlement_cashflow_snapshots_run"):
|
||||
for constraint in (
|
||||
"ON DELETE RESTRICT", "UNIQUE", "transaction_count > 0",
|
||||
"idx_settlement_cashflow_snapshots_run", "exactly one parent",
|
||||
"(settlement_run_id,cashflow_kind,category,subcategory,currency)",
|
||||
"(monthly_settlement_id,cashflow_kind,category,subcategory,currency)",
|
||||
):
|
||||
assert constraint in doc, constraint
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user