a tool for shared writing and social publishing

add custom_domain tables

+125
+125
supabase/migrations/20250117172835_add_custom_domain_tables.sql
··· 1 + create table "public"."custom_domain_routes" ( 2 + "id" uuid not null default gen_random_uuid(), 3 + "domain" text not null, 4 + "route" text not null 5 + ); 6 + 7 + 8 + create table "public"."custom_domains" ( 9 + "domain" text not null, 10 + "identity" text not null default ''::text, 11 + "confirmed" boolean not null 12 + ); 13 + 14 + 15 + alter table "public"."custom_domains" enable row level security; 16 + 17 + alter table "public"."phone_rsvps_to_entity" add column "plus_ones" smallint not null default '0'::smallint; 18 + 19 + CREATE UNIQUE INDEX custom_domain_routes_domain_route_key ON public.custom_domain_routes USING btree (domain, route); 20 + 21 + CREATE UNIQUE INDEX custom_domain_routes_pkey ON public.custom_domain_routes USING btree (id); 22 + 23 + CREATE UNIQUE INDEX custom_domains_pkey ON public.custom_domains USING btree (domain); 24 + 25 + CREATE UNIQUE INDEX identities_email_key ON public.identities USING btree (email); 26 + 27 + alter table "public"."custom_domain_routes" add constraint "custom_domain_routes_pkey" PRIMARY KEY using index "custom_domain_routes_pkey"; 28 + 29 + alter table "public"."custom_domains" add constraint "custom_domains_pkey" PRIMARY KEY using index "custom_domains_pkey"; 30 + 31 + alter table "public"."custom_domain_routes" add constraint "custom_domain_routes_domain_fkey" FOREIGN KEY (domain) REFERENCES custom_domains(domain) not valid; 32 + 33 + alter table "public"."custom_domain_routes" validate constraint "custom_domain_routes_domain_fkey"; 34 + 35 + alter table "public"."custom_domain_routes" add constraint "custom_domain_routes_domain_route_key" UNIQUE using index "custom_domain_routes_domain_route_key"; 36 + 37 + alter table "public"."custom_domains" add constraint "custom_domains_identity_fkey" FOREIGN KEY (identity) REFERENCES identities(email) ON UPDATE CASCADE ON DELETE CASCADE not valid; 38 + 39 + alter table "public"."custom_domains" validate constraint "custom_domains_identity_fkey"; 40 + 41 + alter table "public"."identities" add constraint "identities_email_key" UNIQUE using index "identities_email_key"; 42 + 43 + grant delete on table "public"."custom_domain_routes" to "anon"; 44 + 45 + grant insert on table "public"."custom_domain_routes" to "anon"; 46 + 47 + grant references on table "public"."custom_domain_routes" to "anon"; 48 + 49 + grant select on table "public"."custom_domain_routes" to "anon"; 50 + 51 + grant trigger on table "public"."custom_domain_routes" to "anon"; 52 + 53 + grant truncate on table "public"."custom_domain_routes" to "anon"; 54 + 55 + grant update on table "public"."custom_domain_routes" to "anon"; 56 + 57 + grant delete on table "public"."custom_domain_routes" to "authenticated"; 58 + 59 + grant insert on table "public"."custom_domain_routes" to "authenticated"; 60 + 61 + grant references on table "public"."custom_domain_routes" to "authenticated"; 62 + 63 + grant select on table "public"."custom_domain_routes" to "authenticated"; 64 + 65 + grant trigger on table "public"."custom_domain_routes" to "authenticated"; 66 + 67 + grant truncate on table "public"."custom_domain_routes" to "authenticated"; 68 + 69 + grant update on table "public"."custom_domain_routes" to "authenticated"; 70 + 71 + grant delete on table "public"."custom_domain_routes" to "service_role"; 72 + 73 + grant insert on table "public"."custom_domain_routes" to "service_role"; 74 + 75 + grant references on table "public"."custom_domain_routes" to "service_role"; 76 + 77 + grant select on table "public"."custom_domain_routes" to "service_role"; 78 + 79 + grant trigger on table "public"."custom_domain_routes" to "service_role"; 80 + 81 + grant truncate on table "public"."custom_domain_routes" to "service_role"; 82 + 83 + grant update on table "public"."custom_domain_routes" to "service_role"; 84 + 85 + grant delete on table "public"."custom_domains" to "anon"; 86 + 87 + grant insert on table "public"."custom_domains" to "anon"; 88 + 89 + grant references on table "public"."custom_domains" to "anon"; 90 + 91 + grant select on table "public"."custom_domains" to "anon"; 92 + 93 + grant trigger on table "public"."custom_domains" to "anon"; 94 + 95 + grant truncate on table "public"."custom_domains" to "anon"; 96 + 97 + grant update on table "public"."custom_domains" to "anon"; 98 + 99 + grant delete on table "public"."custom_domains" to "authenticated"; 100 + 101 + grant insert on table "public"."custom_domains" to "authenticated"; 102 + 103 + grant references on table "public"."custom_domains" to "authenticated"; 104 + 105 + grant select on table "public"."custom_domains" to "authenticated"; 106 + 107 + grant trigger on table "public"."custom_domains" to "authenticated"; 108 + 109 + grant truncate on table "public"."custom_domains" to "authenticated"; 110 + 111 + grant update on table "public"."custom_domains" to "authenticated"; 112 + 113 + grant delete on table "public"."custom_domains" to "service_role"; 114 + 115 + grant insert on table "public"."custom_domains" to "service_role"; 116 + 117 + grant references on table "public"."custom_domains" to "service_role"; 118 + 119 + grant select on table "public"."custom_domains" to "service_role"; 120 + 121 + grant trigger on table "public"."custom_domains" to "service_role"; 122 + 123 + grant truncate on table "public"."custom_domains" to "service_role"; 124 + 125 + grant update on table "public"."custom_domains" to "service_role";