-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sql
27 lines (25 loc) · 1.1 KB
/
install.sql
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
-- Create the Branch list table
CREATE TABLE wcf1_unkso_branch (
branchID INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
userGroupID INT(10),
name VARCHAR(255) NOT NULL,
displayOrder INT(10) NOT NULL,
image VARCHAR(500) NOT NULL,
rankUnavailableImage VARCHAR(500) NOT NULL,
isDisabled TINYINT(1) NOT NULL DEFAULT 0
);
-- Create the Ranks list table
CREATE TABLE wcf1_unkso_rank (
rankID INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
branchID INT(10) NOT NULL,
categoryID INT(10) NOT NULL,
paygrade VARCHAR(20) NOT NULL,
prefix VARCHAR(15) NOT NULL,
name VARCHAR(255) NOT NULL,
image VARCHAR(500) NOT NULL,
displayOrder INT(10) NOT NULL,
isDisabled TINYINT(1) NOT NULL DEFAULT 0
);
ALTER TABLE wcf1_unkso_branch ADD FOREIGN KEY (userGroupID) REFERENCES wcf1_user_group (groupID) ON UPDATE CASCADE ON DELETE RESTRICT;
ALTER TABLE wcf1_unkso_rank ADD FOREIGN KEY (branchID) REFERENCES wcf1_unkso_branch (branchID) ON UPDATE CASCADE ON DELETE RESTRICT;
ALTER TABLE wcf1_unkso_rank ADD FOREIGN KEY (categoryID) REFERENCES wcf1_category (categoryID) ON UPDATE CASCADE ON DELETE RESTRICT;