MySQL + Sequelize is working, signup emails working
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
#This file should be used for altering the database in production - make sure it works!
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
#This file only needs to be run once, during initial setup
|
||||
#After this script, next run 'update_database.sql'
|
||||
|
||||
#Create the actual database
|
||||
CREATE DATABASE IF NOT EXISTS template;
|
||||
USE template;
|
||||
|
||||
#Create the database user
|
||||
CREATE USER IF NOT EXISTS 'template'@'%' IDENTIFIED BY 'pikachu';
|
||||
GRANT ALL PRIVILEGES ON template.* TO 'template'@'%';
|
||||
@@ -0,0 +1,52 @@
|
||||
# account system
|
||||
CREATE TABLE IF NOT EXISTS pendingSignups (
|
||||
email VARCHAR(320) UNIQUE,
|
||||
username VARCHAR(100) UNIQUE,
|
||||
hash VARCHAR(100),
|
||||
|
||||
verify INTEGER DEFAULT 0
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS accounts (
|
||||
id INTEGER UNSIGNED AUTO_INCREMENT PRIMARY KEY UNIQUE,
|
||||
td TIMESTAMP DEFAULT CURRENT_TIMESTAMP(),
|
||||
|
||||
privilege ENUM ('administrator', 'moderator', 'alpha', 'beta', 'normal') DEFAULT 'normal',
|
||||
|
||||
email VARCHAR(320) UNIQUE,
|
||||
username VARCHAR(100) UNIQUE,
|
||||
hash VARCHAR(100),
|
||||
|
||||
lastActivityTime TIMESTAMP DEFAULT '2021-01-01 00:00:00',
|
||||
|
||||
deletionTime TIMESTAMP NULL DEFAULT NULL
|
||||
);
|
||||
|
||||
#CREATE TABLE IF NOT EXISTS sessions (
|
||||
# id INTEGER UNSIGNED AUTO_INCREMENT PRIMARY KEY UNIQUE,
|
||||
# td TIMESTAMP DEFAULT CURRENT_TIMESTAMP(),
|
||||
#
|
||||
# accountId INTEGER UNSIGNED,
|
||||
# token INTEGER DEFAULT 0,
|
||||
#
|
||||
# CONSTRAINT FOREIGN KEY fk_sessions_accountId(accountId) REFERENCES accounts(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
#);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS passwordRecover (
|
||||
id INTEGER UNSIGNED AUTO_INCREMENT PRIMARY KEY UNIQUE,
|
||||
td TIMESTAMP DEFAULT CURRENT_TIMESTAMP(),
|
||||
|
||||
accountId INTEGER UNSIGNED UNIQUE,
|
||||
token INTEGER DEFAULT 0,
|
||||
|
||||
CONSTRAINT FOREIGN KEY fk_passwordRecover_accountId(accountId) REFERENCES accounts(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS bannedEmails (
|
||||
id INTEGER UNSIGNED AUTO_INCREMENT PRIMARY KEY UNIQUE,
|
||||
td TIMESTAMP DEFAULT CURRENT_TIMESTAMP(),
|
||||
|
||||
email VARCHAR(320) UNIQUE,
|
||||
reason TEXT,
|
||||
expiry TIMESTAMP NULL DEFAULT NULL
|
||||
);
|
||||
Reference in New Issue
Block a user