From dbcca9c413ca5d4bcb1080383a3efe42d003c34f Mon Sep 17 00:00:00 2001 From: a2a-cloud Date: Sun, 19 Jul 2026 18:58:49 +0000 Subject: [PATCH] a2a-source-edit: write db/migrations/001_app_records.sql --- db/migrations/001_app_records.sql | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/db/migrations/001_app_records.sql b/db/migrations/001_app_records.sql index 9317315..9f05527 100644 --- a/db/migrations/001_app_records.sql +++ b/db/migrations/001_app_records.sql @@ -1,11 +1,17 @@ -CREATE TABLE IF NOT EXISTS app_records ( +CREATE TABLE IF NOT EXISTS execution_receipts ( id BIGSERIAL PRIMARY KEY, tenant_key TEXT NOT NULL, - record_kind TEXT NOT NULL, - payload JSONB NOT NULL, + receipt_id TEXT NOT NULL, + skill_name TEXT NOT NULL, + input_json JSONB NOT NULL, + result_json JSONB NOT NULL, created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), - updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW() + updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + UNIQUE (tenant_key, receipt_id) ); -CREATE INDEX IF NOT EXISTS app_records_tenant_kind_idx - ON app_records (tenant_key, record_kind, created_at DESC); +CREATE INDEX IF NOT EXISTS execution_receipts_tenant_created_idx + ON execution_receipts (tenant_key, created_at DESC); + +CREATE INDEX IF NOT EXISTS execution_receipts_skill_idx + ON execution_receipts (skill_name, created_at DESC);