tangled
alpha
login
or
join now
leaflet.pub
/
leaflet
289
fork
atom
a tool for shared writing and social publishing
289
fork
atom
overview
issues
28
pulls
pipelines
add comments tables
awarm.space
4 months ago
4f6ef4b3
fb3fe27c
+24
1 changed file
expand all
collapse all
unified
split
supabase
migrations
20251030201428_add_notifications_schema_and_comments_notification_table.sql
+24
supabase/migrations/20251030201428_add_notifications_schema_and_comments_notification_table.sql
···
1
1
+
create schema if not exists "notifications";
2
2
+
3
3
+
create table "notifications"."comment_notifications" (
4
4
+
"comment" text not null,
5
5
+
"created_at" timestamp with time zone not null default now(),
6
6
+
"identity" uuid not null,
7
7
+
"reason" text not null,
8
8
+
"read" boolean not null default false
9
9
+
);
10
10
+
11
11
+
12
12
+
alter table "notifications"."comment_notifications" enable row level security;
13
13
+
14
14
+
CREATE UNIQUE INDEX comment_notifications_pkey ON notifications.comment_notifications USING btree (comment, identity);
15
15
+
16
16
+
alter table "notifications"."comment_notifications" add constraint "comment_notifications_pkey" PRIMARY KEY using index "comment_notifications_pkey";
17
17
+
18
18
+
alter table "notifications"."comment_notifications" add constraint "comment_notifications_comment_fkey" FOREIGN KEY (comment) REFERENCES comments_on_documents(uri) ON UPDATE CASCADE ON DELETE CASCADE not valid;
19
19
+
20
20
+
alter table "notifications"."comment_notifications" validate constraint "comment_notifications_comment_fkey";
21
21
+
22
22
+
alter table "notifications"."comment_notifications" add constraint "comment_notifications_identity_fkey" FOREIGN KEY (identity) REFERENCES identities(id) ON UPDATE CASCADE ON DELETE CASCADE not valid;
23
23
+
24
24
+
alter table "notifications"."comment_notifications" validate constraint "comment_notifications_identity_fkey";