summaryrefslogtreecommitdiff
path: root/db/migrations/0213_ordinary_orphan.sql
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-07-18 07:52:02 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-07-18 07:52:02 +0000
commit48a2255bfc45ffcfb0b39ffefdd57cbacf8b36df (patch)
tree0c88b7c126138233875e8d372a4e999e49c38a62 /db/migrations/0213_ordinary_orphan.sql
parent2ef02e27dbe639876fa3b90c30307dda183545ec (diff)
(대표님) 파일관리변경, 클라IP추적, 실시간알림, 미들웨어변경, 알림API
Diffstat (limited to 'db/migrations/0213_ordinary_orphan.sql')
-rw-r--r--db/migrations/0213_ordinary_orphan.sql17
1 files changed, 17 insertions, 0 deletions
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