From 48a2255bfc45ffcfb0b39ffefdd57cbacf8b36df Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Fri, 18 Jul 2025 07:52:02 +0000
Subject: (대표님) 파일관리변경, 클라IP추적, 실시간알림, 미들웨어변경, 알림API
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 db/migrations/0213_ordinary_orphan.sql | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 db/migrations/0213_ordinary_orphan.sql

(limited to 'db/migrations/0213_ordinary_orphan.sql')

diff --git a/db/migrations/0213_ordinary_orphan.sql b/db/migrations/0213_ordinary_orphan.sql
new file mode 100644
index 00000000..682418ed
--- /dev/null
+++ b/db/migrations/0213_ordinary_orphan.sql
@@ -0,0 +1,17 @@
+CREATE TABLE "notifications" (
+	"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
+	"user_id" varchar(255) NOT NULL,
+	"title" varchar(255) NOT NULL,
+	"message" text NOT NULL,
+	"type" varchar(50) NOT NULL,
+	"related_record_id" varchar(255),
+	"related_record_type" varchar(100),
+	"is_read" boolean DEFAULT false NOT NULL,
+	"created_at" timestamp DEFAULT now() NOT NULL,
+	"read_at" timestamp
+);
+--> statement-breakpoint
+CREATE INDEX "idx_notifications_user_id" ON "notifications" USING btree ("user_id");--> statement-breakpoint
+CREATE INDEX "idx_notifications_created_at" ON "notifications" USING btree ("created_at" DESC NULLS LAST);--> statement-breakpoint
+CREATE INDEX "idx_notifications_is_read" ON "notifications" USING btree ("is_read");--> statement-breakpoint
+CREATE INDEX "idx_notifications_user_read" ON "notifications" USING btree ("user_id","is_read");
\ No newline at end of file
-- 
cgit v1.2.3

