-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit_script.sql
More file actions
33 lines (27 loc) · 799 Bytes
/
init_script.sql
File metadata and controls
33 lines (27 loc) · 799 Bytes
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
\c postgres_db;
-- code for making test users
CREATE TABLE users (
id SERIAL PRIMARY KEY,
name VARCHAR(100),
email VARCHAR(100)
);
INSERT INTO users (name, email) VALUES
('Benjamin', 'benjamin@example.com'),
('Hugo', 'hugo@example.com'),
('Matthias', 'matthias@example.com');
-- code for testing authentication
CREATE TABLE IF NOT EXISTS rocket_accounts (
id SERIAL PRIMARY KEY,
email VARCHAR(100) NOT NULL UNIQUE,
password_hash VARCHAR(255) NOT NULL,
role VARCHAR(10) NOT NULL DEFAULT 'user'
);
-- code for making giant test array
CREATE TABLE sorting_test (
id serial PRIMARY KEY,
numbers integer[]
);
-- make the giant array
INSERT INTO sorting_test (numbers)
SELECT array_agg(floor(random() * 1000000)::int)
FROM generate_series(1, 100000);