feat: UI/UX cleanup V1 with header, import requisites, and status fixes
This commit is contained in:
@@ -10,6 +10,7 @@ DAILY_REPORT_OPTIONAL_SYSTEM_MIGRATION = "20260925_daily_report_optional_system"
|
||||
KS2_REPORTING_PERIOD_MIGRATION = "20260925_ks2_reporting_period"
|
||||
PAYMENT_STATUS_MIGRATION = "20260926_payment_status"
|
||||
KS3_NUMBER_UNIQUE_MIGRATION = "20260927_ks3_number_unique"
|
||||
BOQ_DOCUMENT_REQUISITES_MIGRATION = "20260928_boq_document_requisites"
|
||||
|
||||
|
||||
def run_migrations(engine):
|
||||
@@ -198,6 +199,16 @@ def run_migrations(engine):
|
||||
)
|
||||
connection.execute("INSERT INTO schema_migrations(version, applied_at) VALUES (?, ?)",
|
||||
(KS3_NUMBER_UNIQUE_MIGRATION, datetime.now(timezone.utc).isoformat()))
|
||||
if BOQ_DOCUMENT_REQUISITES_MIGRATION not in applied:
|
||||
doc_cols = {row[1] for row in connection.execute("PRAGMA table_info(boq_documents)")}
|
||||
if "document_number" not in doc_cols:
|
||||
connection.execute("ALTER TABLE boq_documents ADD COLUMN document_number VARCHAR")
|
||||
if "document_date" not in doc_cols:
|
||||
connection.execute("ALTER TABLE boq_documents ADD COLUMN document_date DATE")
|
||||
if "contract" not in doc_cols:
|
||||
connection.execute("ALTER TABLE boq_documents ADD COLUMN contract VARCHAR")
|
||||
connection.execute("INSERT INTO schema_migrations(version, applied_at) VALUES (?, ?)",
|
||||
(BOQ_DOCUMENT_REQUISITES_MIGRATION, datetime.now(timezone.utc).isoformat()))
|
||||
violations = connection.execute("PRAGMA foreign_key_check").fetchall()
|
||||
if violations:
|
||||
raise RuntimeError(f"Foreign key violations after agreement migration: {violations[:10]}")
|
||||
|
||||
Reference in New Issue
Block a user