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