Wire intent→coordinator DocResolver confirm cards→action_executor kinds for comment, reopen, pending-supplements query, and real submit-review execution.
27 lines
1.1 KiB
SQL
27 lines
1.1 KiB
SQL
-- +goose Up
|
|
CREATE TABLE IF NOT EXISTS document_pending_supplements (
|
|
id BIGSERIAL PRIMARY KEY,
|
|
doc_id TEXT NOT NULL,
|
|
project_id BIGINT NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
|
|
source_summary TEXT NOT NULL DEFAULT '',
|
|
impact_reason TEXT NOT NULL DEFAULT '',
|
|
initiator_user_id BIGINT NOT NULL DEFAULT 0,
|
|
batch_id TEXT NOT NULL DEFAULT '',
|
|
status TEXT NOT NULL DEFAULT 'pending',
|
|
digested_at TIMESTAMPTZ,
|
|
decided_by BIGINT NOT NULL DEFAULT 0,
|
|
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
|
updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
|
CONSTRAINT chk_dps_status CHECK (status IN ('pending', 'digested', 'discarded'))
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_dps_doc_status ON document_pending_supplements (doc_id, status);
|
|
CREATE INDEX IF NOT EXISTS idx_dps_project_status ON document_pending_supplements (project_id, status);
|
|
|
|
ALTER TABLE supplement_impact_items
|
|
ADD COLUMN IF NOT EXISTS locked_snapshot BOOLEAN NOT NULL DEFAULT FALSE;
|
|
|
|
-- +goose Down
|
|
-- record retention: do not drop tables
|
|
SELECT 1;
|