mirror of
https://github.com/Derpy-Leggies/OnlyLegs.git
synced 2025-01-01 12:26:13 +00:00
Added more tables
Started making table junctions
This commit is contained in:
parent
463c5ecd03
commit
122b1760cf
|
@ -1,7 +0,0 @@
|
||||||
CREATE IF NOT EXISTS TABLE abilities (
|
|
||||||
id INT(69) PRIMARY KEY AUTO_INCREMENT,
|
|
||||||
user INT(69) NOT NULL,
|
|
||||||
admin BOOLEAN NOT NULL DEFAULT FALSE,
|
|
||||||
create_posts BOOLEAN NOT NULL DEFAULT TRUE,
|
|
||||||
updated_at TIMESTAMP NOT NULL DEFAULT NOW() ON UPDATE NOW()
|
|
||||||
);
|
|
51
packages/tables/generate.sql
Normal file
51
packages/tables/generate.sql
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
CREATE IF NOT EXISTS TABLE users (
|
||||||
|
id INT(69) PRIMARY KEY AUTO_INCREMENT,
|
||||||
|
username VARCHAR(255) NOT NULL UNIQUE,
|
||||||
|
email VARCHAR(255) NOT NULL,
|
||||||
|
password VARCHAR(255) NOT NULL,
|
||||||
|
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
|
||||||
|
updated_at TIMESTAMP NOT NULL DEFAULT NOW() ON UPDATE NOW()
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE IF NOT EXISTS TABLE posts (
|
||||||
|
id INT(69) PRIMARY KEY AUTO_INCREMENT,
|
||||||
|
file_name VARCHAR(255) NOT NULL UNIQUE,
|
||||||
|
author_id INT(69) NOT NULL,
|
||||||
|
description TEXT NOT NULL,
|
||||||
|
alt TEXT NOT NULL,
|
||||||
|
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
|
||||||
|
updated_at TIMESTAMP NOT NULL DEFAULT NOW() ON UPDATE NOW()
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE IF NOT EXISTS TABLE groups (
|
||||||
|
id INT(69) PRIMARY KEY AUTO_INCREMENT,
|
||||||
|
author_id INT(69) NOT NULL,
|
||||||
|
name VARCHAR(255) NOT NULL,
|
||||||
|
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
|
||||||
|
updated_at TIMESTAMP NOT NULL DEFAULT NOW() ON UPDATE NOW()
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE IF NOT EXISTS TABLE permissions (
|
||||||
|
id INT(69) PRIMARY KEY AUTO_INCREMENT,
|
||||||
|
user_id INT(69) NOT NULL,
|
||||||
|
admin BOOLEAN NOT NULL DEFAULT FALSE,
|
||||||
|
create_posts BOOLEAN NOT NULL DEFAULT TRUE,
|
||||||
|
updated_at TIMESTAMP NOT NULL DEFAULT NOW() ON UPDATE NOW()
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE IF NOT EXISTS TABLE logs (
|
||||||
|
id INT(69) PRIMARY KEY AUTO_INCREMENT,
|
||||||
|
ip VARCHAR(255) NOT NULL,
|
||||||
|
user_id INT(69) DEFAULT NULL,
|
||||||
|
code INT(69) NOT NULL,
|
||||||
|
note TEXT DEFAULT NULL,
|
||||||
|
created_at TIMESTAMP NOT NULL DEFAULT NOW()
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE IF NOT EXISTS TABLE bans (
|
||||||
|
id INT(69) PRIMARY KEY AUTO_INCREMENT,
|
||||||
|
ip VARCHAR(255) NOT NULL,
|
||||||
|
code INT(69) NOT NULL,
|
||||||
|
note TEXT DEFAULT NULL,
|
||||||
|
created_at TIMESTAMP NOT NULL DEFAULT NOW()
|
||||||
|
);
|
5
packages/tables/junctions.sql
Normal file
5
packages/tables/junctions.sql
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
CREATE IF NOT EXISTS TABLE group_junction (
|
||||||
|
id INT(69) PRIMARY KEY AUTO_INCREMENT,
|
||||||
|
group_id INT(69) NOT NULL,
|
||||||
|
image_id INT(69) NOT NULL
|
||||||
|
);
|
|
@ -1,8 +0,0 @@
|
||||||
CREATE IF NOT EXISTS TABLE users (
|
|
||||||
id INT(69) PRIMARY KEY AUTO_INCREMENT,
|
|
||||||
username VARCHAR(255) NOT NULL,
|
|
||||||
email VARCHAR(255) NOT NULL,
|
|
||||||
password VARCHAR(255) NOT NULL,
|
|
||||||
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
|
|
||||||
updated_at TIMESTAMP NOT NULL DEFAULT NOW() ON UPDATE NOW()
|
|
||||||
);
|
|
Loading…
Reference in a new issue