From c56a28f0480b39730c2ec49da1e8d209249d7879 Mon Sep 17 00:00:00 2001 From: Jared Pereira Date: Thu, 30 Oct 2025 17:02:48 -0400 Subject: [PATCH] just use the public table, postgrest needs it --- ...51030205840_move_notif_table_to_public.sql | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 supabase/migrations/20251030205840_move_notif_table_to_public.sql diff --git a/supabase/migrations/20251030205840_move_notif_table_to_public.sql b/supabase/migrations/20251030205840_move_notif_table_to_public.sql new file mode 100644 index 00000000..dcba88b9 --- /dev/null +++ b/supabase/migrations/20251030205840_move_notif_table_to_public.sql @@ -0,0 +1,67 @@ +create table "public"."notif_comments" ( + "comment" text not null, + "created_at" timestamp with time zone not null default now(), + "identity" uuid not null, + "reason" text not null, + "read" boolean not null default false +); + + +alter table "public"."notif_comments" enable row level security; + +CREATE UNIQUE INDEX notif_comments_pkey ON public.notif_comments USING btree (comment, identity); + +alter table "public"."notif_comments" add constraint "notif_comments_pkey" PRIMARY KEY using index "notif_comments_pkey"; + +alter table "public"."notif_comments" add constraint "notif_comments_comment_fkey" FOREIGN KEY (comment) REFERENCES comments_on_documents(uri) ON UPDATE CASCADE ON DELETE CASCADE not valid; + +alter table "public"."notif_comments" validate constraint "notif_comments_comment_fkey"; + +alter table "public"."notif_comments" add constraint "notif_comments_identity_fkey" FOREIGN KEY (identity) REFERENCES identities(id) ON UPDATE CASCADE ON DELETE CASCADE not valid; + +alter table "public"."notif_comments" validate constraint "notif_comments_identity_fkey"; + +grant delete on table "public"."notif_comments" to "anon"; + +grant insert on table "public"."notif_comments" to "anon"; + +grant references on table "public"."notif_comments" to "anon"; + +grant select on table "public"."notif_comments" to "anon"; + +grant trigger on table "public"."notif_comments" to "anon"; + +grant truncate on table "public"."notif_comments" to "anon"; + +grant update on table "public"."notif_comments" to "anon"; + +grant delete on table "public"."notif_comments" to "authenticated"; + +grant insert on table "public"."notif_comments" to "authenticated"; + +grant references on table "public"."notif_comments" to "authenticated"; + +grant select on table "public"."notif_comments" to "authenticated"; + +grant trigger on table "public"."notif_comments" to "authenticated"; + +grant truncate on table "public"."notif_comments" to "authenticated"; + +grant update on table "public"."notif_comments" to "authenticated"; + +grant delete on table "public"."notif_comments" to "service_role"; + +grant insert on table "public"."notif_comments" to "service_role"; + +grant references on table "public"."notif_comments" to "service_role"; + +grant select on table "public"."notif_comments" to "service_role"; + +grant trigger on table "public"."notif_comments" to "service_role"; + +grant truncate on table "public"."notif_comments" to "service_role"; + +grant update on table "public"."notif_comments" to "service_role"; + +drop table "notifications"."comment_notifications"; +drop schema if exists "notifications"; -- 2.51.2