-
Notifications
You must be signed in to change notification settings - Fork 13
/
03_setup_messages_table.sql
27 lines (26 loc) · 1.02 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
/************************************************************
* Create the messages table
************************************************************/
CREATE TABLE if not exists public.messages
(
id uuid primary key default gen_random_uuid(),
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 postgres;
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);