-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsupabase-schema.sql
More file actions
36 lines (30 loc) · 1.38 KB
/
Copy pathsupabase-schema.sql
File metadata and controls
36 lines (30 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
-- Hacking LinkedIn - Supabase schema
-- Run this once in the Supabase SQL editor.
-- Each table stores one item per row as a JSON blob (so the app's data shape is preserved).
create table if not exists ideas (
id text primary key,
data jsonb not null,
updated_at timestamptz default now()
);
create table if not exists creators (
handle text primary key,
data jsonb not null
);
create table if not exists inspiration (
id text primary key,
data jsonb not null
);
create table if not exists photos (
id text primary key,
data jsonb not null
);
-- Single-user personal tool: let the anon key read/write.
-- (If you ever want to lock it to a login, we swap these for auth-based policies.)
alter table ideas enable row level security;
alter table creators enable row level security;
alter table inspiration enable row level security;
alter table photos enable row level security;
create policy "anon full access - ideas" on ideas for all to anon, authenticated using (true) with check (true);
create policy "anon full access - creators" on creators for all to anon, authenticated using (true) with check (true);
create policy "anon full access - inspiration" on inspiration for all to anon, authenticated using (true) with check (true);
create policy "anon full access - photos" on photos for all to anon, authenticated using (true) with check (true);