a2a-source-edit: write db/migrations/001_quote_judge.sql
This commit is contained in:
@@ -2,7 +2,7 @@ CREATE TABLE IF NOT EXISTS quote_comparisons (
|
|||||||
tenant_key TEXT NOT NULL,
|
tenant_key TEXT NOT NULL,
|
||||||
comparison_id TEXT NOT NULL,
|
comparison_id TEXT NOT NULL,
|
||||||
recommendation_vendor TEXT NOT NULL,
|
recommendation_vendor TEXT NOT NULL,
|
||||||
result JSONB NOT NULL,
|
payload JSONB NOT NULL,
|
||||||
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
||||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
||||||
PRIMARY KEY (tenant_key, comparison_id)
|
PRIMARY KEY (tenant_key, comparison_id)
|
||||||
@@ -11,16 +11,16 @@ CREATE TABLE IF NOT EXISTS quote_comparisons (
|
|||||||
CREATE INDEX IF NOT EXISTS quote_comparisons_tenant_updated_idx
|
CREATE INDEX IF NOT EXISTS quote_comparisons_tenant_updated_idx
|
||||||
ON quote_comparisons (tenant_key, updated_at DESC);
|
ON quote_comparisons (tenant_key, updated_at DESC);
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS quote_judge_receipts (
|
CREATE TABLE IF NOT EXISTS quote_execution_receipts (
|
||||||
receipt_id TEXT PRIMARY KEY,
|
id BIGSERIAL PRIMARY KEY,
|
||||||
tenant_key TEXT NOT NULL,
|
tenant_key TEXT NOT NULL,
|
||||||
comparison_id TEXT NOT NULL,
|
comparison_id TEXT NOT NULL,
|
||||||
tool_name TEXT NOT NULL,
|
skill_name TEXT NOT NULL,
|
||||||
status TEXT NOT NULL,
|
status TEXT NOT NULL,
|
||||||
input_hash TEXT NOT NULL,
|
task_id TEXT NOT NULL DEFAULT '',
|
||||||
payload JSONB NOT NULL,
|
receipt JSONB NOT NULL,
|
||||||
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE INDEX IF NOT EXISTS quote_judge_receipts_tenant_comparison_idx
|
CREATE INDEX IF NOT EXISTS quote_execution_receipts_tenant_comparison_idx
|
||||||
ON quote_judge_receipts (tenant_key, comparison_id, created_at DESC);
|
ON quote_execution_receipts (tenant_key, comparison_id, created_at DESC);
|
||||||
|
|||||||
Reference in New Issue
Block a user