task-d.5.3

This commit is contained in:
phaichayon
2026-06-24 14:23:15 +07:00
parent 350239b307
commit 0c28735c90
61 changed files with 11019 additions and 173 deletions

View File

@@ -0,0 +1,30 @@
ALTER TABLE "crm_enquiries"
ADD COLUMN IF NOT EXISTS "closed_won_at" timestamp with time zone,
ADD COLUMN IF NOT EXISTS "closed_lost_at" timestamp with time zone,
ADD COLUMN IF NOT EXISTS "closed_by_user_id" text,
ADD COLUMN IF NOT EXISTS "po_number" text,
ADD COLUMN IF NOT EXISTS "po_date" timestamp with time zone,
ADD COLUMN IF NOT EXISTS "po_amount" double precision,
ADD COLUMN IF NOT EXISTS "po_currency" text,
ADD COLUMN IF NOT EXISTS "lost_reason" text,
ADD COLUMN IF NOT EXISTS "lost_competitor" text,
ADD COLUMN IF NOT EXISTS "lost_remark" text;
CREATE TABLE IF NOT EXISTS "crm_enquiry_attachments" (
"id" text PRIMARY KEY NOT NULL,
"organization_id" text NOT NULL,
"enquiry_id" text NOT NULL,
"category" text NOT NULL,
"file_name" text NOT NULL,
"original_file_name" text NOT NULL,
"storage_provider" text NOT NULL,
"storage_key" text NOT NULL,
"file_size" integer,
"file_type" text,
"description" text,
"uploaded_at" timestamp with time zone DEFAULT now() NOT NULL,
"uploaded_by" text 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
);