mirror of
https://github.com/renee-png/acmcc.git
synced 2026-06-21 01:40:01 +00:00
183fe0a93c
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
29 lines
1.0 KiB
SQL
29 lines
1.0 KiB
SQL
-- Add attachment URL column to calendar_events
|
|
ALTER TABLE public.calendar_events
|
|
ADD COLUMN IF NOT EXISTS attachment_url text,
|
|
ADD COLUMN IF NOT EXISTS attachment_name text;
|
|
|
|
-- Create public bucket for calendar attachments (meeting notices, etc.)
|
|
INSERT INTO storage.buckets (id, name, public)
|
|
VALUES ('calendar-attachments', 'calendar-attachments', true)
|
|
ON CONFLICT (id) DO NOTHING;
|
|
|
|
-- Storage policies
|
|
CREATE POLICY "Calendar attachments are publicly viewable"
|
|
ON storage.objects FOR SELECT
|
|
USING (bucket_id = 'calendar-attachments');
|
|
|
|
CREATE POLICY "Authenticated users can upload calendar attachments"
|
|
ON storage.objects FOR INSERT
|
|
TO authenticated
|
|
WITH CHECK (bucket_id = 'calendar-attachments');
|
|
|
|
CREATE POLICY "Authenticated users can update calendar attachments"
|
|
ON storage.objects FOR UPDATE
|
|
TO authenticated
|
|
USING (bucket_id = 'calendar-attachments');
|
|
|
|
CREATE POLICY "Authenticated users can delete calendar attachments"
|
|
ON storage.objects FOR DELETE
|
|
TO authenticated
|
|
USING (bucket_id = 'calendar-attachments'); |