a tool for shared writing and social publishing
at update/thread-viewer 60 lines 2.2 kB view raw
1create table "public"."notifications" ( 2 "recipient" text not null, 3 "created_at" timestamp with time zone not null default now(), 4 "read" boolean not null default false, 5 "data" jsonb not null, 6 "id" uuid not null 7); 8 9 10alter table "public"."notifications" enable row level security; 11 12CREATE UNIQUE INDEX notifications_pkey ON public.notifications USING btree (id); 13 14alter table "public"."notifications" add constraint "notifications_pkey" PRIMARY KEY using index "notifications_pkey"; 15 16alter table "public"."notifications" add constraint "notifications_recipient_fkey" FOREIGN KEY (recipient) REFERENCES identities(atp_did) ON UPDATE CASCADE ON DELETE CASCADE not valid; 17 18alter table "public"."notifications" validate constraint "notifications_recipient_fkey"; 19 20grant delete on table "public"."notifications" to "anon"; 21 22grant insert on table "public"."notifications" to "anon"; 23 24grant references on table "public"."notifications" to "anon"; 25 26grant select on table "public"."notifications" to "anon"; 27 28grant trigger on table "public"."notifications" to "anon"; 29 30grant truncate on table "public"."notifications" to "anon"; 31 32grant update on table "public"."notifications" to "anon"; 33 34grant delete on table "public"."notifications" to "authenticated"; 35 36grant insert on table "public"."notifications" to "authenticated"; 37 38grant references on table "public"."notifications" to "authenticated"; 39 40grant select on table "public"."notifications" to "authenticated"; 41 42grant trigger on table "public"."notifications" to "authenticated"; 43 44grant truncate on table "public"."notifications" to "authenticated"; 45 46grant update on table "public"."notifications" to "authenticated"; 47 48grant delete on table "public"."notifications" to "service_role"; 49 50grant insert on table "public"."notifications" to "service_role"; 51 52grant references on table "public"."notifications" to "service_role"; 53 54grant select on table "public"."notifications" to "service_role"; 55 56grant trigger on table "public"."notifications" to "service_role"; 57 58grant truncate on table "public"."notifications" to "service_role"; 59 60grant update on table "public"."notifications" to "service_role";