From 717e92cda09e05c8e20f8f727ceb714e83ffb622 Mon Sep 17 00:00:00 2001 From: a2a-cloud Date: Sun, 19 Jul 2026 19:55:10 +0000 Subject: [PATCH] a2a-source-edit: write db/migrations/001_app_records.sql --- db/migrations/001_app_records.sql | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 db/migrations/001_app_records.sql diff --git a/db/migrations/001_app_records.sql b/db/migrations/001_app_records.sql new file mode 100644 index 0000000..9317315 --- /dev/null +++ b/db/migrations/001_app_records.sql @@ -0,0 +1,11 @@ +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);