a tool for shared writing and social publishing
at main 118 lines 4.5 kB view raw
1create table "public"."bsky_posts" ( 2 "uri" text not null, 3 "indexed_at" timestamp with time zone not null default now(), 4 "post_view" jsonb not null, 5 "cid" text not null 6); 7 8 9alter table "public"."bsky_posts" enable row level security; 10 11create table "public"."document_mentions_in_bsky" ( 12 "uri" text not null, 13 "link" text not null, 14 "document" text not null 15); 16 17alter table "public"."document_mentions_in_bsky" enable row level security; 18 19CREATE UNIQUE INDEX bsky_posts_pkey ON public.bsky_posts USING btree (uri); 20 21CREATE UNIQUE INDEX document_mentions_in_bsky_pkey ON public.document_mentions_in_bsky USING btree (uri, document); 22 23alter table "public"."bsky_posts" add constraint "bsky_posts_pkey" PRIMARY KEY using index "bsky_posts_pkey"; 24 25alter table "public"."document_mentions_in_bsky" add constraint "document_mentions_in_bsky_pkey" PRIMARY KEY using index "document_mentions_in_bsky_pkey"; 26 27 28alter table "public"."document_mentions_in_bsky" add constraint "document_mentions_in_bsky_document_fkey" FOREIGN KEY (document) REFERENCES documents(uri) ON DELETE CASCADE not valid; 29 30alter table "public"."document_mentions_in_bsky" validate constraint "document_mentions_in_bsky_document_fkey"; 31 32alter table "public"."document_mentions_in_bsky" add constraint "document_mentions_in_bsky_uri_fkey" FOREIGN KEY (uri) REFERENCES bsky_posts(uri) ON DELETE CASCADE not valid; 33 34alter table "public"."document_mentions_in_bsky" validate constraint "document_mentions_in_bsky_uri_fkey"; 35 36grant delete on table "public"."bsky_posts" to "anon"; 37 38grant insert on table "public"."bsky_posts" to "anon"; 39 40grant references on table "public"."bsky_posts" to "anon"; 41 42grant select on table "public"."bsky_posts" to "anon"; 43 44grant trigger on table "public"."bsky_posts" to "anon"; 45 46grant truncate on table "public"."bsky_posts" to "anon"; 47 48grant update on table "public"."bsky_posts" to "anon"; 49 50grant delete on table "public"."bsky_posts" to "authenticated"; 51 52grant insert on table "public"."bsky_posts" to "authenticated"; 53 54grant references on table "public"."bsky_posts" to "authenticated"; 55 56grant select on table "public"."bsky_posts" to "authenticated"; 57 58grant trigger on table "public"."bsky_posts" to "authenticated"; 59 60grant truncate on table "public"."bsky_posts" to "authenticated"; 61 62grant update on table "public"."bsky_posts" to "authenticated"; 63 64grant delete on table "public"."bsky_posts" to "service_role"; 65 66grant insert on table "public"."bsky_posts" to "service_role"; 67 68grant references on table "public"."bsky_posts" to "service_role"; 69 70grant select on table "public"."bsky_posts" to "service_role"; 71 72grant trigger on table "public"."bsky_posts" to "service_role"; 73 74grant truncate on table "public"."bsky_posts" to "service_role"; 75 76grant update on table "public"."bsky_posts" to "service_role"; 77 78grant delete on table "public"."document_mentions_in_bsky" to "anon"; 79 80grant insert on table "public"."document_mentions_in_bsky" to "anon"; 81 82grant references on table "public"."document_mentions_in_bsky" to "anon"; 83 84grant select on table "public"."document_mentions_in_bsky" to "anon"; 85 86grant trigger on table "public"."document_mentions_in_bsky" to "anon"; 87 88grant truncate on table "public"."document_mentions_in_bsky" to "anon"; 89 90grant update on table "public"."document_mentions_in_bsky" to "anon"; 91 92grant delete on table "public"."document_mentions_in_bsky" to "authenticated"; 93 94grant insert on table "public"."document_mentions_in_bsky" to "authenticated"; 95 96grant references on table "public"."document_mentions_in_bsky" to "authenticated"; 97 98grant select on table "public"."document_mentions_in_bsky" to "authenticated"; 99 100grant trigger on table "public"."document_mentions_in_bsky" to "authenticated"; 101 102grant truncate on table "public"."document_mentions_in_bsky" to "authenticated"; 103 104grant update on table "public"."document_mentions_in_bsky" to "authenticated"; 105 106grant delete on table "public"."document_mentions_in_bsky" to "service_role"; 107 108grant insert on table "public"."document_mentions_in_bsky" to "service_role"; 109 110grant references on table "public"."document_mentions_in_bsky" to "service_role"; 111 112grant select on table "public"."document_mentions_in_bsky" to "service_role"; 113 114grant trigger on table "public"."document_mentions_in_bsky" to "service_role"; 115 116grant truncate on table "public"."document_mentions_in_bsky" to "service_role"; 117 118grant update on table "public"."document_mentions_in_bsky" to "service_role";