Skip to content

Commit

Permalink
fix notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerFisher committed Jan 1, 2025
1 parent 5a2a4d8 commit 065e141
Show file tree
Hide file tree
Showing 4 changed files with 2,178 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/components/nav/Nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ const Nav = ({
label: "Daily Digest",
icon: <Mail className={styles["nav-list-item-icon"]} />,
},
{
to: "/notifications",
label: "Notifications",
icon: <Bell className={styles["nav-list-item-icon"]} />,
},
// {
// to: "/notifications",
// label: "Notifications",
// icon: <Bell className={styles["nav-list-item-icon"]} />,
// },
{
to: "/moderation",
label: "Mute",
Expand Down
30 changes: 30 additions & 0 deletions app/drizzle/0029_cultured_la_nuit.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
CREATE TABLE IF NOT EXISTS "notification_group" (
"id" uuid PRIMARY KEY NOT NULL,
"name" text NOT NULL,
"query" json NOT NULL,
"notificationType" "digest_type" DEFAULT 'email' NOT NULL,
"feedUrl" text,
"seenLinks" json DEFAULT '[]'::json NOT NULL,
"userId" uuid NOT NULL,
"createdAt" timestamp (3) DEFAULT CURRENT_TIMESTAMP NOT NULL
);
--> statement-breakpoint
CREATE TABLE IF NOT EXISTS "notification_item" (
"id" uuid PRIMARY KEY NOT NULL,
"notificationGroupId" uuid NOT NULL,
"itemData" json NOT NULL,
"itemHtml" text,
"createdAt" timestamp (3) DEFAULT CURRENT_TIMESTAMP NOT NULL
);
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "notification_group" ADD CONSTRAINT "notification_group_userId_user_id_fk" FOREIGN KEY ("userId") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "notification_item" ADD CONSTRAINT "notification_item_notificationGroupId_notification_group_id_fk" FOREIGN KEY ("notificationGroupId") REFERENCES "public"."notification_group"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
Loading

0 comments on commit 065e141

Please sign in to comment.