a tool for shared writing and social publishing
at main 64 lines 2.8 kB view raw
1create table "public"."publication_subscriptions" ( 2 "publication" text not null, 3 "identity" text not null, 4 "created_at" timestamp with time zone not null default now(), 5 "record" jsonb not null, 6 "uri" text 7); 8 9 10alter table "public"."publication_subscriptions" enable row level security; 11 12CREATE UNIQUE INDEX publication_subscriptions_pkey ON public.publication_subscriptions USING btree (publication, identity); 13 14CREATE UNIQUE INDEX publication_subscriptions_uri_key ON public.publication_subscriptions USING btree (uri); 15 16alter table "public"."publication_subscriptions" add constraint "publication_subscriptions_pkey" PRIMARY KEY using index "publication_subscriptions_pkey"; 17 18alter table "public"."publication_subscriptions" add constraint "publication_subscriptions_publication_fkey" FOREIGN KEY (publication) REFERENCES publications(uri) ON DELETE CASCADE not valid; 19 20alter table "public"."publication_subscriptions" validate constraint "publication_subscriptions_publication_fkey"; 21 22alter table "public"."publication_subscriptions" add constraint "publication_subscriptions_uri_key" UNIQUE using index "publication_subscriptions_uri_key"; 23 24grant delete on table "public"."publication_subscriptions" to "anon"; 25 26grant insert on table "public"."publication_subscriptions" to "anon"; 27 28grant references on table "public"."publication_subscriptions" to "anon"; 29 30grant select on table "public"."publication_subscriptions" to "anon"; 31 32grant trigger on table "public"."publication_subscriptions" to "anon"; 33 34grant truncate on table "public"."publication_subscriptions" to "anon"; 35 36grant update on table "public"."publication_subscriptions" to "anon"; 37 38grant delete on table "public"."publication_subscriptions" to "authenticated"; 39 40grant insert on table "public"."publication_subscriptions" to "authenticated"; 41 42grant references on table "public"."publication_subscriptions" to "authenticated"; 43 44grant select on table "public"."publication_subscriptions" to "authenticated"; 45 46grant trigger on table "public"."publication_subscriptions" to "authenticated"; 47 48grant truncate on table "public"."publication_subscriptions" to "authenticated"; 49 50grant update on table "public"."publication_subscriptions" to "authenticated"; 51 52grant delete on table "public"."publication_subscriptions" to "service_role"; 53 54grant insert on table "public"."publication_subscriptions" to "service_role"; 55 56grant references on table "public"."publication_subscriptions" to "service_role"; 57 58grant select on table "public"."publication_subscriptions" to "service_role"; 59 60grant trigger on table "public"."publication_subscriptions" to "service_role"; 61 62grant truncate on table "public"."publication_subscriptions" to "service_role"; 63 64grant update on table "public"."publication_subscriptions" to "service_role";