diff --git a/db.cfc b/db.cfc index 7194c0e..4b9ea33 100644 --- a/db.cfc +++ b/db.cfc @@ -129,6 +129,32 @@ component rest="true" restPath="db" { old_values JSONB, new_values JSONB, created_at TIMESTAMPTZ DEFAULT now() + )", + "CREATE TABLE IF NOT EXISTS spec_events ( + id UUID PRIMARY KEY DEFAULT gen_random_uuid(), + contract_id UUID REFERENCES contracts(id), + supplement_id UUID REFERENCES supplements(id), + seq INTEGER NOT NULL, + action TEXT NOT NULL, + target_hash TEXT, + new_values JSONB, + comment TEXT, + status TEXT DEFAULT 'applied', + created_at TIMESTAMPTZ DEFAULT now(), + UNIQUE(contract_id, seq) + )", + "CREATE TABLE IF NOT EXISTS spec_current ( + id UUID PRIMARY KEY DEFAULT gen_random_uuid(), + contract_id UUID REFERENCES contracts(id), + name_hash TEXT NOT NULL, + name TEXT, + price NUMERIC, + qty NUMERIC, + sum NUMERIC, + date_start TEXT, + last_event_id UUID REFERENCES spec_events(id), + updated_at TIMESTAMPTZ DEFAULT now(), + UNIQUE(contract_id, name_hash) )" ]; diff --git a/index.cfm b/index.cfm index 2e382fe..a4a5075 100644 --- a/index.cfm +++ b/index.cfm @@ -61,7 +61,7 @@
Nubes - Сверка договоров — LLM v1.0.69 — Lucee + Сверка договоров — LLM v1.0.70 — Lucee