| 1 | CREATE TYPE "public"."milestone_status" AS ENUM('pending', 'in_progress', 'completed', 'blocked');--> statement-breakpoint |
| 2 | CREATE TABLE "milestone_requirements" ( |
| 3 | "id" text PRIMARY KEY |
| 4 | "milestone_id" text NOT NULL |
| 5 | "requirement_id" text NOT NULL |
| 6 | "sort_order" integer DEFAULT |
| 7 | ); |
| 8 | --> statement-breakpoint |
| 9 | CREATE TABLE "milestones" ( |
| 10 | "id" text PRIMARY KEY |
| 11 | "project_id" text NOT NULL |
| 12 | "name" text NOT NULL |
| 13 | "description" text, |
| 14 | "status" "milestone_status" DEFAULT |
| 15 | "sort_order" integer DEFAULT |
| 16 | "due_date" timestamp, |
| 17 | "completed_at" timestamp, |
| 18 | "budget_minutes" integer, |
| 19 | "budget_amount_cents" integer, |
| 20 | "block_reason" text, |
| 21 | "created_at" timestamp DEFAULT |
| 22 | "updated_at" timestamp DEFAULT |
| 23 | ); |
| 24 | --> statement-breakpoint |
| 25 | ALTER TABLE "milestone_requirements" ADD |
| 26 | ALTER TABLE "milestone_requirements" ADD |
| 27 | ALTER TABLE "milestones" ADD |
| 28 | CREATE UNIQUE INDEX "milestone_requirement_unique" ON |