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;