From 2ffc24fac1d4d4b184d603ef74c13559c11bd23f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CNaeel=E2=80=9D?= Date: Sat, 20 Jun 2026 09:55:48 +0400 Subject: [PATCH] Phase 1: spec_events + spec_current tables (v1.0.70) --- db.cfc | 26 ++++++++++++++++++++++++++ index.cfm | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) 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