2021-09-17 04:07:17 +00:00
|
|
|
CREATE DATABASE IF NOT EXISTS `habbgo`;
|
2021-09-09 03:40:28 +00:00
|
|
|
|
2021-09-19 02:23:14 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS `Players` (
|
|
|
|
`ID` INT PRIMARY KEY AUTO_INCREMENT,
|
2021-09-17 04:07:17 +00:00
|
|
|
`Username` VARCHAR(16) NOT NULL UNIQUE,
|
2021-09-19 02:23:14 +00:00
|
|
|
`PasswordHash` TEXT NOT NULL,
|
|
|
|
`PasswordSalt` VARBINARY NOT NULL,
|
2021-09-17 04:07:17 +00:00
|
|
|
`SSOToken` TEXT DEFAULT NULL,
|
|
|
|
`Sex` ENUM('M','F') NOT NULL DEFAULT 'F',
|
|
|
|
`Figure` TEXT NOT NULL DEFAULT '1000118001270012900121001',
|
|
|
|
`PoolFigure` TEXT,
|
|
|
|
`Film` INT DEFAULT 0,
|
|
|
|
`Credits` INT DEFAULT 100,
|
|
|
|
`Tickets` INT DEFAULT 0,
|
|
|
|
`Motto` TEXT DEFAULT 'Project HabbGo.',
|
|
|
|
`ConsoleMotto` TEXT DEFAULT 'HabbGo Rocks!',
|
2021-09-19 02:23:14 +00:00
|
|
|
`DisplayBadge` BOOL NOT NULL DEFAULT true,
|
2021-09-17 04:07:17 +00:00
|
|
|
`CurrentBadge` INT,
|
2021-09-19 02:23:14 +00:00
|
|
|
`Birthday` DATE NOT NULL,
|
|
|
|
`Email` TEXT NOT NULL,
|
|
|
|
`SoundEnabled` BOOL NOT NULL DEFAULT true,
|
2021-09-17 04:07:17 +00:00
|
|
|
`CreatedOn` DATETIME NOT NULL,
|
|
|
|
`LastOnline` DATETIME,
|
2021-09-19 02:23:14 +00:00
|
|
|
FOREIGN KEY (CurrentBadge) REFERENCES Badges (ID)
|
2021-09-17 04:07:17 +00:00
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
2021-09-16 05:28:27 +00:00
|
|
|
|
2021-09-19 02:23:14 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS `Badges` (
|
2021-09-17 04:07:17 +00:00
|
|
|
`ID` INT PRIMARY KEY AUTO_INCREMENT,
|
|
|
|
`Code` VARCHAR(3) UNIQUE NOT NULL
|
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
2021-09-16 05:28:27 +00:00
|
|
|
|
2021-09-17 04:07:17 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS `PlayerBadges` (
|
|
|
|
`PlayerID` INT,
|
|
|
|
`Badge` INT,
|
2021-09-19 02:23:14 +00:00
|
|
|
FOREIGN KEY (PlayerID) REFERENCES Players (ID) ON DELETE CASCADE,
|
|
|
|
FOREIGN KEY (Badge) REFERENCES Badges (ID)
|
2021-09-17 04:07:17 +00:00
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|