-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathintern_task_mysql_dump.sql
More file actions
24 lines (22 loc) · 988 Bytes
/
intern_task_mysql_dump.sql
File metadata and controls
24 lines (22 loc) · 988 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
-- MySQL dump for intern task
CREATE DATABASE IF NOT EXISTS intern_task CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
USE intern_task;
CREATE TABLE IF NOT EXISTS auth_user (
id INT AUTO_INCREMENT PRIMARY KEY,
email VARCHAR(255) NOT NULL UNIQUE,
first_name VARCHAR(100) NOT NULL,
last_name VARCHAR(100) NOT NULL,
password VARCHAR(255) NOT NULL,
created_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS teachers (
id INT AUTO_INCREMENT PRIMARY KEY,
user_id INT NOT NULL UNIQUE,
university_name VARCHAR(255) NOT NULL,
gender ENUM('Male','Female','Other') NOT NULL,
year_joined INT NOT NULL,
created_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
CONSTRAINT fk_teachers_user FOREIGN KEY (user_id) REFERENCES auth_user(id) ON DELETE CASCADE
) ENGINE=InnoDB;