0013_deploy_history.sql 722 B

12345678910111213141516171819
  1. -- deploy_history — one row per api boot, written from src/index.ts after
  2. -- migrations succeed. Drives the admin "Deploys" widget and is the audit
  3. -- trail behind /info.buildSha. See apps/api/src/db/schema.ts for the
  4. -- field-level reasoning.
  5. CREATE TABLE IF NOT EXISTS "deploy_history" (
  6. "id" text PRIMARY KEY NOT NULL,
  7. "service" text NOT NULL,
  8. "build_sha" text NOT NULL,
  9. "build_at" text,
  10. "env" text NOT NULL,
  11. "booted_at" timestamp with time zone DEFAULT now() NOT NULL
  12. );
  13. CREATE INDEX IF NOT EXISTS "deploy_history_service_booted_idx"
  14. ON "deploy_history" USING btree ("service", "booted_at");
  15. CREATE INDEX IF NOT EXISTS "deploy_history_build_sha_idx"
  16. ON "deploy_history" USING btree ("build_sha");