forked from burggraf/supabase-mailer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path03_setup_messages_table.sql
28 lines (27 loc) · 1.07 KB
/
03_setup_messages_table.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/************************************************************
* Create the messages table
************************************************************/
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE TABLE if not exists public.messages
(
id uuid primary key default uuid_generate_v4(),
recipient text,
sender text,
cc text,
bcc text,
subject text,
text_body text,
html_body text,
created timestamp with time zone DEFAULT CURRENT_TIMESTAMP,
status text,
deliveryresult jsonb,
deliverysignature jsonb,
log jsonb
);
ALTER TABLE public.messages OWNER TO supabase_admin;
ALTER TABLE public.messages ENABLE ROW LEVEL SECURITY;
-- Turn off all access to the messages table by default
CREATE POLICY "messages delete policy" ON public.messages FOR DELETE USING (false);
CREATE POLICY "messages insert policy" ON public.messages FOR INSERT WITH CHECK (false);
CREATE POLICY "messages select policy" ON public.messages FOR SELECT USING (false);
CREATE POLICY "messages update policy" ON public.messages FOR UPDATE USING (false) WITH CHECK (false);