-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathDB.sql
More file actions
28 lines (26 loc) · 836 Bytes
/
DB.sql
File metadata and controls
28 lines (26 loc) · 836 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
--- USER
CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
full_name VARCHAR(50) NOT NULL,
username VARCHAR(50) NOT NULL,
password VARCHAR(255) NOT NULL,
role ENUM('admin', 'employee') NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE tasks (
id INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(100) NOT NULL,
description TEXT,
assigned_to INT,
status ENUM('pending', 'in_progress', 'completed') DEFAULT 'pending',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (assigned_to) REFERENCES users(id)
);
CREATE TABLE notifications (
id INT AUTO_INCREMENT PRIMARY KEY,
message TEXT NOT NULL,
recipient INT NOT NULL,
type VARCHAR(50) NOT NULL,
date DATE NOT NULL,
is_read BOOLEAN DEFAULT FALSE
);