-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.sql
More file actions
36 lines (32 loc) · 1.18 KB
/
schema.sql
File metadata and controls
36 lines (32 loc) · 1.18 KB
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
28
29
30
31
32
33
34
35
36
-- Subscribers represent a subscriber to a given list within
-- a our system.
-- We default to is_subscribed on creation
CREATE TABLE subscribers (
subscriber_id UUID primary key,
email text NOT NULL,
is_subscribed BOOL DEFAULT 't',
created_at TIMESTAMP DEFAULT CURRENT_TIME,
updated_at TIMESTAMP DEFAULT CURRENT_TIME,
deleted_at TIMESTAMP
);
-- Notifications represent a specific type of notification within
-- the system. This could be a `WelcomeNotification` that we send out
-- whenever a new customer joins, or a `MonthlyUpdate` that we send out
-- on a successful monthly payment
CREATE TABLE notifications (
notification_id UUID primary key,
notification_name text,
html text,
created_at TIMESTAMP DEFAULT CURRENT_TIME,
updated_at TIMESTAMP DEFAULT CURRENT_TIME,
deleted_at TIMESTAMP
);
-- List represents different subscriber groups, for example `Premium` which would
-- contain all subscribers that have a premium subscription for the site.
CREATE TABLE list (
list_id UUID primary key,
list_name text NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIME,
updated_at TIMESTAMP DEFAULT CURRENT_TIME,
deleted_at TIMESTAMP
);