From 81e246746e85cb7acdae0c942d1177a54a0aa14b Mon Sep 17 00:00:00 2001 From: a2a-cloud Date: Sat, 18 Jul 2026 04:43:47 +0000 Subject: [PATCH] a2a-source-edit: write db/migrations/001_app_records.sql --- db/migrations/001_app_records.sql | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/db/migrations/001_app_records.sql b/db/migrations/001_app_records.sql index e976dd5..9317315 100644 --- a/db/migrations/001_app_records.sql +++ b/db/migrations/001_app_records.sql @@ -1,3 +1,11 @@ --- Retained migration slot from the full-stack scaffold. --- QuoteJudge product tables live in 001_quotejudge.sql. -SELECT 1; +CREATE TABLE IF NOT EXISTS app_records ( + id BIGSERIAL PRIMARY KEY, + tenant_key TEXT NOT NULL, + record_kind TEXT NOT NULL, + payload JSONB NOT NULL, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW() +); + +CREATE INDEX IF NOT EXISTS app_records_tenant_kind_idx + ON app_records (tenant_key, record_kind, created_at DESC);