-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdb
More file actions
28 lines (24 loc) · 725 Bytes
/
Copy pathdb
File metadata and controls
28 lines (24 loc) · 725 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
docker exec -it sampler-services-mysql-1 mysql -p
mysql -h sampler-db -u root -ppassword secret
use sampler-db;
show tables;
create table users(
userid INT NOT NULL AUTO_INCREMENT,
email VARCHAR(225) NOT NULL,
username VARCHAR(225) NOT NULL,
passcode varchar(100) NOT NULL,
created DATETIME NOT NULL,
PRIMARY KEY ( userid )
);
create table observations(
observationid INT NOT NULL AUTO_INCREMENT,
userid INT NOT NULL,
feeling VARCHAR(225) NOT NULL,
company VARCHAR(225) NOT NULL,
activity varchar(225) NOT NULL,
created DATETIME NOT NULL,
PRIMARY KEY ( observationid ),
CONSTRAINT FK_UserObservations FOREIGN KEY (userid)
REFERENCES users(userid)
ON DELETE CASCADE
);