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