Changes
Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
co-authored by
renee-png
parent
4d87143beb
commit
5924f3f4b7
@@ -2037,6 +2037,7 @@ export type Database = {
|
||||
incoming_emails: {
|
||||
Row: {
|
||||
attachment_count: number
|
||||
attachments: Json
|
||||
body_html: string | null
|
||||
body_text: string | null
|
||||
case_id: string | null
|
||||
@@ -2065,6 +2066,7 @@ export type Database = {
|
||||
}
|
||||
Insert: {
|
||||
attachment_count?: number
|
||||
attachments?: Json
|
||||
body_html?: string | null
|
||||
body_text?: string | null
|
||||
case_id?: string | null
|
||||
@@ -2093,6 +2095,7 @@ export type Database = {
|
||||
}
|
||||
Update: {
|
||||
attachment_count?: number
|
||||
attachments?: Json
|
||||
body_html?: string | null
|
||||
body_text?: string | null
|
||||
case_id?: string | null
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
ALTER TABLE public.incoming_emails
|
||||
ADD COLUMN IF NOT EXISTS attachments jsonb NOT NULL DEFAULT '[]'::jsonb;
|
||||
|
||||
INSERT INTO storage.buckets (id, name, public)
|
||||
VALUES ('email-attachments', 'email-attachments', false)
|
||||
ON CONFLICT (id) DO NOTHING;
|
||||
|
||||
CREATE POLICY "email_attachments_select_auth"
|
||||
ON storage.objects FOR SELECT
|
||||
TO authenticated
|
||||
USING (bucket_id = 'email-attachments');
|
||||
|
||||
CREATE POLICY "email_attachments_insert_auth"
|
||||
ON storage.objects FOR INSERT
|
||||
TO authenticated
|
||||
WITH CHECK (bucket_id = 'email-attachments');
|
||||
|
||||
CREATE POLICY "email_attachments_delete_admin"
|
||||
ON storage.objects FOR DELETE
|
||||
TO authenticated
|
||||
USING (bucket_id = 'email-attachments' AND public.is_admin(auth.uid()));
|
||||
Reference in New Issue
Block a user