forked from zolfagharipour/Matcha
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path001_users.sql
More file actions
22 lines (21 loc) · 961 Bytes
/
001_users.sql
File metadata and controls
22 lines (21 loc) · 961 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
CREATE TABLE IF NOT EXISTS users (
id INT PRIMARY KEY AUTO_INCREMENT,
email VARCHAR(255) NOT NULL UNIQUE,
username VARCHAR(255) NOT NULL UNIQUE,
first_name VARCHAR(255) NOT NULL,
last_name VARCHAR(255) NOT NULL,
password_hash VARCHAR(255) NOT NULL,
email_verified BOOLEAN NOT NULL DEFAULT FALSE,
email_verification_token VARCHAR(255) UNIQUE DEFAULT NULL,
email_verification_expires_at TIMESTAMP DEFAULT NULL,
password_reset_token VARCHAR(255) UNIQUE DEFAULT NULL,
password_reset_expires_at TIMESTAMP DEFAULT NULL,
pending_new_email VARCHAR(255) UNIQUE DEFAULT NULL,
pending_new_email_token VARCHAR(255) DEFAULT NULL,
pending_new_email_expires_at TIMESTAMP DEFAULT NULL,
is_admin BOOLEAN NOT NULL DEFAULT FALSE,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
INDEX idx_users_email (email),
INDEX idx_users_username (username)
);