-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathinit.sql
30 lines (23 loc) · 790 Bytes
/
init.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
28
29
30
-- Initialization ------------------------------------------------------------
--
-- NOTE: The role lemmingpants and the database lemmingpants must exist!
DROP SCHEMA IF EXISTS model CASCADE;
CREATE SCHEMA model AUTHORIZATION lemmingpants;
DROP SCHEMA IF EXISTS api CASCADE;
CREATE SCHEMA api AUTHORIZATION lemmingpants;
CREATE TYPE model.state AS ENUM ('init', 'active', 'done');
CREATE TYPE api.jwt_token AS (token TEXT);
-- The data model for Lemmingpants
\i sql/model.sql
\i sql/model/agenda_item.sql
\i sql/model/speaker_queue.sql
\i sql/model/attendee.sql
\i sql/model/speaker.sql
-- Public tables, views and functions
\i sql/api/attendee.sql
\i sql/api/agenda_item.sql
\i sql/api/speaker_queue.sql
\i sql/api/speaker.sql
\i sql/api/auth.sql
-- Example data
\i sql/example.sql