-
Notifications
You must be signed in to change notification settings - Fork 0
/
database.sql
36 lines (31 loc) · 905 Bytes
/
database.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
31
32
33
34
35
36
-- this isn't a complete schema
-- missing schema for original job_calls table
-- this is for tables that were added for the auth and email alert systems
--don't forget to set uuid extension
--don't forget to set uuid extension on users table
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE TABLE users(
user_id uuid PRIMARY KEY DEFAULT
--user_id SERIAL PRIMARY KEY DEFAULT
uuid_generate_v4(),
user_name VARCHAR(255) NOT NULL,
user_email VARCHAR(255) UNIQUE NOT NULL,
user_password VARCHAR(255) NOT NULL
);
--alerts stored as comma separated values, just update the entire entry when changes are made
CREATE TABLE user_alerts(
user_id uuid PRIMARY KEY,
user_email VARCHAR(255) UNIQUE NOT NULL,
alerts_companies TEXT,
alerts_classes TEXT
);
--insert fake users
INSERT INTO users(
user_name,
user_email,
user_password
) VALUES (
'pat',
);