-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy path20240908062042_schema.sql
More file actions
36 lines (32 loc) · 907 Bytes
/
20240908062042_schema.sql
File metadata and controls
36 lines (32 loc) · 907 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
34
35
36
CREATE TYPE user_role AS ENUM ('user', 'admin');
CREATE TYPE account_type AS ENUM ('legacy', 'normal');
CREATE TYPE user_group AS ENUM ('local', 'global', 'other');
CREATE TYPE color AS
(
red INT,
green int,
blue int
);
CREATE TABLE users
(
id SERIAL PRIMARY KEY,
first_name VARCHAR(128) NOT NULL,
last_name VARCHAR(128) NOT NULL,
email VARCHAR(128) NOT NULL UNIQUE,
role user_role NOT NULL,
type account_type,
"group" user_group NOT NULL DEFAULT 'local',
disabled TEXT,
favourite_color color DEFAULT NULL,
last_login TIMESTAMP DEFAULT NULL
);
CREATE TABLE users_with_string_id
(
id TEXT PRIMARY KEY,
first_name VARCHAR(128) NOT NULL
);
CREATE TABLE test
(
id SERIAL PRIMARY KEY,
rows TEXT[] NOT NULL
);