feat(supabase): sheet asset Storage bucket + read policy through the sheet, shim storage tables, seeds in the PGlite harness, upload script
This commit is contained in:
1 parent
12f0b21fdf
commit
f4682cdba5
10 files changed
+294
-7
No files matched your search
@@ -73,3 +73,35 @@ grant usage on schema extensions to anon, authenticated, service_role;
|
||||
alter default privileges in schema public grant all on tables to anon, authenticated, service_role;
|
||||
alter default privileges in schema public grant all on functions to anon, authenticated, service_role;
|
||||
alter default privileges in schema public grant all on sequences to anon, authenticated, service_role;
|
||||
|
||||
-- Storage schema stand-in (buckets + objects only, the columns the
|
||||
-- migrations and tests touch). The real stack ships the full schema owned by
|
||||
-- supabase_storage_admin; policies declared on storage.objects apply there.
|
||||
create schema storage;
|
||||
grant usage on schema storage to anon, authenticated, service_role;
|
||||
|
||||
create table storage.buckets (
|
||||
id text primary key,
|
||||
name text not null,
|
||||
owner uuid,
|
||||
public boolean default false,
|
||||
file_size_limit bigint,
|
||||
allowed_mime_types text[],
|
||||
created_at timestamptz default now(),
|
||||
updated_at timestamptz default now()
|
||||
);
|
||||
|
||||
create table storage.objects (
|
||||
id uuid primary key default gen_random_uuid(),
|
||||
bucket_id text references storage.buckets (id),
|
||||
name text,
|
||||
owner uuid,
|
||||
metadata jsonb,
|
||||
created_at timestamptz default now(),
|
||||
updated_at timestamptz default now(),
|
||||
last_accessed_at timestamptz default now()
|
||||
);
|
||||
|
||||
alter table storage.objects enable row level security;
|
||||
grant select on storage.buckets to anon, authenticated, service_role;
|
||||
grant select, insert, update, delete on storage.objects to anon, authenticated, service_role;
|
||||
Reference in new issue
Block a user