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