feat: 角色卡 demo
This commit is contained in:
31
wei_ai_app/supabase/migrations/003_create_storage.sql
Normal file
31
wei_ai_app/supabase/migrations/003_create_storage.sql
Normal file
@@ -0,0 +1,31 @@
|
||||
-- =============================================
|
||||
-- Wei AI App - Storage Bucket 创建
|
||||
-- 注意:Storage 的 bucket 需要通过 Supabase Dashboard 或 API 创建
|
||||
-- 这个 SQL 仅用于记录需要创建的 bucket
|
||||
-- =============================================
|
||||
|
||||
-- Storage Bucket 配置说明:
|
||||
--
|
||||
-- Bucket Name: avatars
|
||||
-- Public: true (头像需要公开访问)
|
||||
-- File Size Limit: 5MB
|
||||
-- Allowed MIME Types: image/png, image/jpeg, image/webp, image/gif
|
||||
--
|
||||
-- 在 Supabase Studio 中手动创建,或使用以下 API:
|
||||
--
|
||||
-- POST /storage/v1/bucket
|
||||
-- {
|
||||
-- "id": "avatars",
|
||||
-- "name": "avatars",
|
||||
-- "public": true,
|
||||
-- "file_size_limit": 5242880,
|
||||
-- "allowed_mime_types": ["image/png", "image/jpeg", "image/webp", "image/gif"]
|
||||
-- }
|
||||
|
||||
-- Storage RLS 策略(需要在 Supabase Dashboard 中配置)
|
||||
-- 允许所有人读取头像
|
||||
-- CREATE POLICY "Public Access" ON storage.objects FOR SELECT USING (bucket_id = 'avatars');
|
||||
--
|
||||
-- 仅允许管理员上传(后续可修改)
|
||||
-- CREATE POLICY "Admin Upload" ON storage.objects FOR INSERT
|
||||
-- WITH CHECK (bucket_id = 'avatars' AND auth.role() = 'service_role');
|
||||
Reference in New Issue
Block a user