From 92eda21e45d902663052575aaa4c4f80bfa2faea Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Mon, 4 Aug 2025 09:36:14 +0000
Subject: (대표님) 벤더 문서 변경사항, data-table 변경, sync 변경
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 db/migrations/0244_nebulous_mandarin.sql | 5 +++++
 1 file changed, 5 insertions(+)
 create mode 100644 db/migrations/0244_nebulous_mandarin.sql

(limited to 'db/migrations/0244_nebulous_mandarin.sql')

diff --git a/db/migrations/0244_nebulous_mandarin.sql b/db/migrations/0244_nebulous_mandarin.sql
new file mode 100644
index 00000000..cbe71273
--- /dev/null
+++ b/db/migrations/0244_nebulous_mandarin.sql
@@ -0,0 +1,5 @@
+ALTER TABLE "documents" ADD COLUMN "project_id" integer NOT NULL;--> statement-breakpoint
+ALTER TABLE "documents" ADD CONSTRAINT "documents_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "public"."projects"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+CREATE UNIQUE INDEX "unique_project_doc_status" ON "documents" USING btree ("project_id","doc_number","status");--> statement-breakpoint
+CREATE UNIQUE INDEX "unique_project_vendor_doc" ON "documents" USING btree ("project_id","vendor_doc_number") WHERE "documents"."vendor_doc_number" IS NOT NULL;--> statement-breakpoint
+CREATE UNIQUE INDEX "unique_external_doc_project" ON "documents" USING btree ("project_id","external_document_id","external_system_type") WHERE "documents"."external_document_id" IS NOT NULL;
\ No newline at end of file
-- 
cgit v1.2.3

