-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmysql.sql
More file actions
29 lines (25 loc) · 820 Bytes
/
mysql.sql
File metadata and controls
29 lines (25 loc) · 820 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
CREATE DATABASE email_security;
USE email_security;
CREATE TABLE quarantined_emails (
id INT AUTO_INCREMENT PRIMARY KEY,
sender VARCHAR(255),
recipient VARCHAR(255),
subject VARCHAR(255),
body TEXT,
received_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE consultation_users (
id INT AUTO_INCREMENT PRIMARY KEY,
full_name VARCHAR(190) NOT NULL,
email VARCHAR(190) NOT NULL UNIQUE,
password_hash VARCHAR(255) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE consultation_requests (
id INT AUTO_INCREMENT PRIMARY KEY,
user_id INT NOT NULL,
topic VARCHAR(190) NOT NULL,
message TEXT NOT NULL,
requested_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (user_id) REFERENCES consultation_users(id) ON DELETE CASCADE
);