· 8 years ago · Apr 17, 2018, 12:28 AM
1CREATE TABLE IF NOT EXISTS `servers` (
2 `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
3 `name` VARCHAR(16) NOT NULL COMMENT 'The name of the server',
4 `abbreviation` VARCHAR(8) NULL COMMENT 'Simple abbreviation for the servers name',
5 `port` SMALLINT UNSIGNED NOT NULL COMMENT 'Port number of the server',
6 `max_players` SMALLINT UNSIGNED NOT NULL COMMENT 'The max numbers of players that can play on the server at the same time',
7 `gamemode_ids` INT UNSIGNED NOT NULL,
8 PRIMARY KEY (`id`),
9 UNIQUE INDEX `name_UNIQUE` (`name` ASC),
10 UNIQUE INDEX `port_UNIQUE` (`port` ASC),
11 INDEX `fk_servers_gamemodes1_idx` (`gamemode_ids` ASC),
12 CONSTRAINT `server_gamemode_id`
13 FOREIGN KEY (`gamemode_ids`)
14 REFERENCES `gamemodes` (`id`)
15 ON DELETE NO ACTION
16 ON UPDATE CASCADE)
17ENGINE = InnoDB