peppa/packages/db/migrations/0013_pep57_releases.sql
Асель 59c3b583de PEP-57: CD — deploy workflow, preview/staging/prod, health check and rollback, releases
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 14:49:24 +05:00

20 lines
724 B
SQL

CREATE TABLE "releases" (
"id" serial PRIMARY KEY NOT NULL,
"project_id" integer NOT NULL,
"env" text NOT NULL,
"sha" text NOT NULL,
"previous_sha" text,
"image" text,
"host" text,
"pr_number" integer,
"tasks" jsonb DEFAULT '[]'::jsonb NOT NULL,
"status" text DEFAULT 'deploying' NOT NULL,
"deployed_by" text DEFAULT 'ci' NOT NULL,
"reason" text,
"run_url" text,
"log_tail" text,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "releases" ADD CONSTRAINT "releases_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "public"."projects"("id") ON DELETE cascade ON UPDATE no action;