🚀 Initial commit: Versão atual do TrackSteel APP

This commit is contained in:
2026-03-18 21:17:53 +00:00
commit bde410c9ad
633 changed files with 108150 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
-- Criar bucket para fotos de perfil
INSERT INTO storage.buckets (id, name, public, file_size_limit, allowed_mime_types)
VALUES (
'profile-images',
'profile-images',
true,
5242880, -- 5MB limit
ARRAY['image/jpeg', 'image/png', 'image/gif', 'image/webp']
);
-- Política para permitir que usuários façam upload de suas próprias fotos
CREATE POLICY "Users can upload their own profile images"
ON storage.objects
FOR INSERT
WITH CHECK (
bucket_id = 'profile-images'
AND auth.uid()::text = (storage.foldername(name))[1]
);
-- Política para permitir que usuários atualizem suas próprias fotos
CREATE POLICY "Users can update their own profile images"
ON storage.objects
FOR UPDATE
USING (
bucket_id = 'profile-images'
AND auth.uid()::text = (storage.foldername(name))[1]
);
-- Política para permitir que usuários deletem suas próprias fotos
CREATE POLICY "Users can delete their own profile images"
ON storage.objects
FOR DELETE
USING (
bucket_id = 'profile-images'
AND auth.uid()::text = (storage.foldername(name))[1]
);
-- Política para permitir que todos vejam as fotos de perfil (públicas)
CREATE POLICY "Profile images are publicly viewable"
ON storage.objects
FOR SELECT
USING (bucket_id = 'profile-images');