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