feat(CC-066): add action_plans and scenarios tables (migration 0012)
This commit is contained in:
parent
972a0f6f9d
commit
641c68ed91
1 changed files with 36 additions and 0 deletions
36
drizzle/0012_action_plans_scenarios.sql
Normal file
36
drizzle/0012_action_plans_scenarios.sql
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
-- CC-066: action_plans + scenarios
|
||||
CREATE TABLE IF NOT EXISTS "action_plans" (
|
||||
"id" uuid DEFAULT gen_random_uuid() PRIMARY KEY NOT NULL,
|
||||
"tenant_id" uuid NOT NULL,
|
||||
"workspace_id" uuid,
|
||||
"title" text NOT NULL,
|
||||
"description" text,
|
||||
"status" text DEFAULT 'draft' NOT NULL,
|
||||
"priority" text DEFAULT 'medium' NOT NULL,
|
||||
"owner" text,
|
||||
"due_date" date,
|
||||
"completed_at" timestamp,
|
||||
"decision_id" uuid,
|
||||
"goal_id" uuid,
|
||||
"project_id" uuid,
|
||||
"tags" text[] DEFAULT '{}' NOT NULL,
|
||||
"created_at" timestamp DEFAULT now() NOT NULL,
|
||||
"updated_at" timestamp DEFAULT now() NOT NULL,
|
||||
"deleted_at" timestamp
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "scenarios" (
|
||||
"id" uuid DEFAULT gen_random_uuid() PRIMARY KEY NOT NULL,
|
||||
"tenant_id" uuid NOT NULL,
|
||||
"decision_id" uuid,
|
||||
"title" text NOT NULL,
|
||||
"description" text,
|
||||
"probability" text DEFAULT 'medium' NOT NULL,
|
||||
"outcome" text,
|
||||
"financial_impact_minor_units" numeric(15,0),
|
||||
"financial_impact_currency" text DEFAULT 'RON' NOT NULL,
|
||||
"impact_direction" text DEFAULT 'neutral' NOT NULL,
|
||||
"status" text DEFAULT 'hypothetical' NOT NULL,
|
||||
"created_at" timestamp DEFAULT now() NOT NULL,
|
||||
"updated_at" timestamp DEFAULT now() NOT NULL
|
||||
);
|
||||
Loading…
Reference in a new issue