feat: add KS-2 UI, reporting period, and table layout fixes
- 004: KS-2 UI (list, create, edit, view, issue) with integration tests - 005: navigation buttons, financial column alignment, button layout - 006: reporting_period_from/to fields with migration, validation, display - 007: fixed table layout with colgroup, quantity2 filter, stable column widths
This commit is contained in:
@@ -7,6 +7,7 @@ SCOPE_MIGRATION = "20260925_agreement_scope_boq"
|
||||
ITEM_WORK_ITEM_MIGRATION = "20260925_agreement_item_work_item_required"
|
||||
WORK_ITEM_OPTIONAL_BOQ_MIGRATION = "20260925_work_item_optional_boq"
|
||||
DAILY_REPORT_OPTIONAL_SYSTEM_MIGRATION = "20260925_daily_report_optional_system"
|
||||
KS2_REPORTING_PERIOD_MIGRATION = "20260925_ks2_reporting_period"
|
||||
|
||||
|
||||
def run_migrations(engine):
|
||||
@@ -169,6 +170,14 @@ def run_migrations(engine):
|
||||
connection.execute("CREATE INDEX IF NOT EXISTS ix_daily_reports_report_date ON daily_reports (report_date)")
|
||||
connection.execute("INSERT INTO schema_migrations(version, applied_at) VALUES (?, ?)",
|
||||
(DAILY_REPORT_OPTIONAL_SYSTEM_MIGRATION, datetime.now(timezone.utc).isoformat()))
|
||||
if KS2_REPORTING_PERIOD_MIGRATION not in applied:
|
||||
ks2_cols = {row[1] for row in connection.execute("PRAGMA table_info(ks2_documents)")}
|
||||
if "reporting_period_from" not in ks2_cols:
|
||||
connection.execute("ALTER TABLE ks2_documents ADD COLUMN reporting_period_from DATE")
|
||||
if "reporting_period_to" not in ks2_cols:
|
||||
connection.execute("ALTER TABLE ks2_documents ADD COLUMN reporting_period_to DATE")
|
||||
connection.execute("INSERT INTO schema_migrations(version, applied_at) VALUES (?, ?)",
|
||||
(KS2_REPORTING_PERIOD_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