-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatabase.sql
71 lines (61 loc) · 1.62 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
CREATE DATABASE datingApp;
--set extention
CREATE TABLE users(
user_id uuid PRIMARY KEY DEFAULT
uuid_generate_v4(),
user_email VARCHAR(255) NOT NULL UNIQUE,
user_password VARCHAR(255) NOT NULL,
first_name VARCHAR(255),
last_name VARCHAR(255),
age VARCHAR(30),
gender VARCHAR(6),
country VARCHAR(30),
city VARCHAR(30)
);
-- table user_images
CREATE TABLE user_images(
image_id uuid PRIMARY KEY DEFAULT
uuid_generate_v4(),
user_id uuid,
url VARCHAR(255) NOT NULL
);
-- table prompts
CREATE TABLE prompts(
prompts_id uuid PRIMARY KEY DEFAULT
uuid_generate_v4(),
user_id uuid,
prompts1 VARCHAR(255),
prompts2 VARCHAR(255),
Prompts3 VARCHAR(255),
FOREIGN KEY (user_id) REFERENCES users(user_id)
);
-- table coaches
CREATE TABLE coaches(
id uuid PRIMARY KEY DEFAULT
uuid_generate_v4(),
user_id uuid,
email VARCHAR(255) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
first_name VARCHAR(255),
last_name VARCHAR(255),
birth DATE,
gender VARCHAR(6),
about VARCHAR(500),
social_links VARCHAR(255),
personal_website VARCHAR(255),
areas VARCHAR(50),
city VARCHAR(30),
country VARCHAR(30),
speciaty text[]
);
-- table coaches_images
CREATE TABLE coach_images(
image_id uuid PRIMARY KEY DEFAULT
uuid_generate_v4(),
coach_id uuid,
url VARCHAR(255) NOT NULL
);
--insert fake users
INSERT INTO users (user_name, user_email, user_password) VALUES ('henry', 'henryly123@gmail.com')
--insert fake users
INSERT INTO todoItems (user_id, description) values ('cb56588b-7976-412e-b4c8-68fadd51b9f3', 'hello world')