notification added in with subs :D

This commit is contained in:
2026-03-20 23:43:52 -05:00
parent 751c8f21ab
commit 2021141967
37 changed files with 5174 additions and 359 deletions

View File

@@ -0,0 +1,9 @@
CREATE TABLE "notifications" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"name" text NOT NULL,
"description" text NOT NULL,
"active" boolean DEFAULT false,
"options" jsonb DEFAULT '[]'::jsonb
);
--> statement-breakpoint
CREATE UNIQUE INDEX "notify_name" ON "notifications" USING btree ("name");

View File

@@ -0,0 +1 @@
ALTER TABLE "notifications" ADD COLUMN "interval" text DEFAULT '5';

View File

@@ -0,0 +1,10 @@
CREATE TABLE "notification_sub" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"user_id" text NOT NULL,
"notification_id" uuid NOT NULL,
"emails" text[] DEFAULT '{}',
CONSTRAINT "notification_sub_user_notification_unique" UNIQUE("user_id","notification_id")
);
--> statement-breakpoint
ALTER TABLE "notification_sub" ADD CONSTRAINT "notification_sub_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "notification_sub" ADD CONSTRAINT "notification_sub_notification_id_notifications_id_fk" FOREIGN KEY ("notification_id") REFERENCES "public"."notifications"("id") ON DELETE cascade ON UPDATE no action;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -113,6 +113,27 @@
"when": 1772415040979,
"tag": "0015_neat_donald_blake",
"breakpoints": true
},
{
"idx": 16,
"version": "7",
"when": 1774026354811,
"tag": "0016_colorful_exiles",
"breakpoints": true
},
{
"idx": 17,
"version": "7",
"when": 1774030327338,
"tag": "0017_famous_joseph",
"breakpoints": true
},
{
"idx": 18,
"version": "7",
"when": 1774032587305,
"tag": "0018_lowly_wallow",
"breakpoints": true
}
]
}