This commit is contained in:
phaichayon
2026-06-27 10:04:43 +07:00
parent 2ace5dbb83
commit 3fdd681dd0
29 changed files with 8593 additions and 15 deletions

View File

@@ -0,0 +1,38 @@
CREATE TABLE "crm_approval_escalation_policies" (
"id" text PRIMARY KEY NOT NULL,
"organization_id" text NOT NULL,
"workflow_id" text NOT NULL,
"step_number" integer NOT NULL,
"trigger_after_hours" integer NOT NULL,
"target_type" text NOT NULL,
"target_value" text,
"is_active" boolean DEFAULT true NOT NULL,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
"updated_at" timestamp with time zone DEFAULT now() NOT NULL,
"deleted_at" timestamp with time zone,
"created_by" text NOT NULL,
"updated_by" text NOT NULL
);
--> statement-breakpoint
CREATE TABLE "crm_approval_reminder_policies" (
"id" text PRIMARY KEY NOT NULL,
"organization_id" text NOT NULL,
"workflow_id" text NOT NULL,
"step_number" integer NOT NULL,
"sla_hours" integer DEFAULT 24 NOT NULL,
"reminder_offsets_hours" integer[] DEFAULT '{}' NOT NULL,
"calendar_mode" text DEFAULT 'calendar_days' NOT NULL,
"timeout_action" text DEFAULT 'none' NOT NULL,
"is_active" boolean DEFAULT true NOT NULL,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
"updated_at" timestamp with time zone DEFAULT now() NOT NULL,
"deleted_at" timestamp with time zone,
"created_by" text NOT NULL,
"updated_by" text NOT NULL
);
--> statement-breakpoint
ALTER TABLE "crm_approval_requests" ADD COLUMN "current_step_started_at" timestamp with time zone DEFAULT now() NOT NULL;--> statement-breakpoint
ALTER TABLE "crm_approval_steps" ADD COLUMN "sla_hours" integer DEFAULT 24 NOT NULL;--> statement-breakpoint
ALTER TABLE "crm_approval_steps" ADD COLUMN "calendar_mode" text DEFAULT 'calendar_days' NOT NULL;--> statement-breakpoint
ALTER TABLE "crm_approval_steps" ADD COLUMN "timeout_action" text DEFAULT 'none' NOT NULL;--> statement-breakpoint
CREATE UNIQUE INDEX "crm_approval_reminder_policies_workflow_step_idx" ON "crm_approval_reminder_policies" USING btree ("workflow_id","step_number");

File diff suppressed because it is too large Load Diff

View File

@@ -36,6 +36,13 @@
"when": 1782455991734,
"tag": "0004_unusual_hairball",
"breakpoints": true
},
{
"idx": 5,
"version": "7",
"when": 1782464526434,
"tag": "0005_furry_maelstrom",
"breakpoints": true
}
]
}