diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-08-13 11:05:09 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-08-13 11:05:09 +0000 |
| commit | 33be47506f0aa62b969d82521580a29e95080268 (patch) | |
| tree | 6b7e232f2d78ef8775944ea085a36b3ccbce7d95 /db/migrations/0275_busy_madelyne_pryor.sql | |
| parent | 2ac95090157c355ea1bd0b8eb1e1e5e2bd56faf4 (diff) | |
(대표님) 입찰, 법무검토, EDP 변경사항 대응, dolce 개선, form-data 개선, 정규업체 등록관리 추가
(최겸) pq 미사용 컴포넌트 및 페이지 제거, 파일 라우트에 pq 적용
Diffstat (limited to 'db/migrations/0275_busy_madelyne_pryor.sql')
| -rw-r--r-- | db/migrations/0275_busy_madelyne_pryor.sql | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/db/migrations/0275_busy_madelyne_pryor.sql b/db/migrations/0275_busy_madelyne_pryor.sql new file mode 100644 index 00000000..f3f33621 --- /dev/null +++ b/db/migrations/0275_busy_madelyne_pryor.sql @@ -0,0 +1,76 @@ +CREATE TABLE "knox"."approval_lines" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, + "name" text NOT NULL, + "description" text, + "category" text, + "aplns" jsonb NOT NULL, + "createdBy" integer NOT NULL, + "createdAt" timestamp DEFAULT now() NOT NULL, + "updatedAt" timestamp DEFAULT now() NOT NULL +); +--> statement-breakpoint +CREATE TABLE "knox"."approval_logs" ( + "ap_inf_id" text PRIMARY KEY NOT NULL, + "user_id" text NOT NULL, + "ep_id" text NOT NULL, + "email_address" text NOT NULL, + "subject" text NOT NULL, + "content" text NOT NULL, + "status" text NOT NULL, + "aplns" jsonb NOT NULL, + "is_deleted" boolean DEFAULT false NOT NULL, + "created_at" timestamp DEFAULT now() NOT NULL, + "updated_at" timestamp DEFAULT now() NOT NULL +); +--> statement-breakpoint +CREATE TABLE "knox"."approval_template_history" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, + "templateId" uuid NOT NULL, + "version" integer NOT NULL, + "subject" text NOT NULL, + "content" text NOT NULL, + "changeDescription" text, + "changedBy" integer NOT NULL, + "createdAt" timestamp DEFAULT now() NOT NULL +); +--> statement-breakpoint +CREATE TABLE "knox"."approval_template_variables" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, + "approvalTemplateId" uuid, + "variableName" text NOT NULL, + "variableType" text NOT NULL, + "defaultValue" text, + "description" text, + "createdBy" integer NOT NULL, + "createdAt" timestamp DEFAULT now() NOT NULL, + "updatedAt" timestamp DEFAULT now() NOT NULL +); +--> statement-breakpoint +CREATE TABLE "knox"."approval_templates" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, + "name" text NOT NULL, + "subject" text NOT NULL, + "content" text NOT NULL, + "description" text, + "category" text, + "approvalLineId" uuid, + "createdBy" integer NOT NULL, + "createdAt" timestamp DEFAULT now() NOT NULL, + "updatedAt" timestamp DEFAULT now() NOT NULL +); +--> statement-breakpoint +ALTER TABLE "knox"."approval" DISABLE ROW LEVEL SECURITY;--> statement-breakpoint +DROP TABLE "knox"."approval" CASCADE;--> statement-breakpoint +ALTER TABLE "procurement_rfqs" DROP CONSTRAINT "procurement_rfqs_project_id_projects_id_fk"; +--> statement-breakpoint +ALTER TABLE "procurement_rfqs" ALTER COLUMN "project_id" SET DATA TYPE varchar(1000);--> statement-breakpoint +ALTER TABLE "procurement_rfqs" ALTER COLUMN "due_date" DROP NOT NULL;--> statement-breakpoint +ALTER TABLE "projects" ADD COLUMN "pspid" char(24);--> statement-breakpoint +ALTER TABLE "knox"."approval_lines" ADD CONSTRAINT "approval_lines_createdBy_users_id_fk" FOREIGN KEY ("createdBy") REFERENCES "public"."users"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "knox"."approval_template_history" ADD CONSTRAINT "approval_template_history_templateId_approval_templates_id_fk" FOREIGN KEY ("templateId") REFERENCES "knox"."approval_templates"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "knox"."approval_template_history" ADD CONSTRAINT "approval_template_history_changedBy_users_id_fk" FOREIGN KEY ("changedBy") REFERENCES "public"."users"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "knox"."approval_template_variables" ADD CONSTRAINT "approval_template_variables_approvalTemplateId_approval_templates_id_fk" FOREIGN KEY ("approvalTemplateId") REFERENCES "knox"."approval_templates"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "knox"."approval_template_variables" ADD CONSTRAINT "approval_template_variables_createdBy_users_id_fk" FOREIGN KEY ("createdBy") REFERENCES "public"."users"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "knox"."approval_templates" ADD CONSTRAINT "approval_templates_approvalLineId_approval_lines_id_fk" FOREIGN KEY ("approvalLineId") REFERENCES "knox"."approval_lines"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "knox"."approval_templates" ADD CONSTRAINT "approval_templates_createdBy_users_id_fk" FOREIGN KEY ("createdBy") REFERENCES "public"."users"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "projects" ADD CONSTRAINT "projects_pspid_unique" UNIQUE("pspid");
\ No newline at end of file |
