-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreatedb.sql
More file actions
28 lines (26 loc) · 844 Bytes
/
Copy pathcreatedb.sql
File metadata and controls
28 lines (26 loc) · 844 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
-- Criação da tabela de usuários
CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(255) NOT NULL,
password VARCHAR(255) NOT NULL,
is_admin TINYINT(1) NOT NULL DEFAULT 0
);
-- Criação da tabela de status de deploy
CREATE TABLE deploy_status (
id INT AUTO_INCREMENT PRIMARY KEY,
project VARCHAR(255) NOT NULL,
status VARCHAR(255) NOT NULL,
user_id INT,
last_user INT,
FOREIGN KEY (user_id) REFERENCES users(id),
FOREIGN KEY (last_user) REFERENCES users(id)
);
-- Criação da tabela de audit log
CREATE TABLE audit_log (
id INT AUTO_INCREMENT PRIMARY KEY,
user_id INT NOT NULL,
action VARCHAR(255) NOT NULL,
project VARCHAR(255),
datetime TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (user_id) REFERENCES users(id)
);