a2a-source-edit: write db/migrations/001_app_records.sql

This commit is contained in:
a2a-cloud
2026-07-18 15:48:07 +00:00
parent ec7527f928
commit 9345c8f69b

View File

@@ -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);