2016-08-07 17:09:08 +00:00
|
|
|
-- new naming convention
|
|
|
|
ALTER TABLE `aliases`
|
|
|
|
RENAME TO `alias`;
|
2016-03-09 10:32:57 +00:00
|
|
|
|
2016-08-07 17:09:08 +00:00
|
|
|
ALTER TABLE `levels`
|
|
|
|
RENAME TO `level`;
|
2016-03-09 10:32:57 +00:00
|
|
|
|
2016-08-07 17:09:08 +00:00
|
|
|
ALTER TABLE `maps`
|
|
|
|
RENAME TO `map`;
|
2016-03-09 10:32:57 +00:00
|
|
|
|
2016-08-07 17:09:08 +00:00
|
|
|
ALTER TABLE `players`
|
|
|
|
RENAME TO `player`;
|
2016-03-09 10:32:57 +00:00
|
|
|
|
2016-08-07 17:09:08 +00:00
|
|
|
ALTER TABLE `records`
|
|
|
|
RENAME TO `record`;
|
2016-03-09 10:32:57 +00:00
|
|
|
|
2016-08-07 17:09:08 +00:00
|
|
|
ALTER TABLE `warns`
|
|
|
|
RENAME TO `warn`;
|
2016-03-09 10:32:57 +00:00
|
|
|
|
2016-08-07 17:09:08 +00:00
|
|
|
ALTER TABLE `alias`
|
2016-03-09 10:32:57 +00:00
|
|
|
DROP FOREIGN KEY `aliasplayer`,
|
|
|
|
DROP INDEX `playerid_idx`;
|
2016-08-07 17:09:08 +00:00
|
|
|
ALTER TABLE `alias`
|
2016-03-09 10:32:57 +00:00
|
|
|
CHANGE COLUMN `player` `player_id` INT(10) UNSIGNED NOT NULL;
|
2016-08-07 17:09:08 +00:00
|
|
|
ALTER TABLE `alias`
|
2016-03-09 10:32:57 +00:00
|
|
|
ADD CONSTRAINT `alias_player`
|
|
|
|
FOREIGN KEY (`player_id`)
|
2016-08-07 17:09:08 +00:00
|
|
|
REFERENCES `player` (`id`)
|
2016-03-09 10:32:57 +00:00
|
|
|
ON DELETE NO ACTION
|
|
|
|
ON UPDATE NO ACTION,
|
|
|
|
ADD INDEX `player_idx` (`player_id` ASC);
|
|
|
|
|
2016-08-07 17:09:08 +00:00
|
|
|
ALTER TABLE `level`
|
2016-03-09 10:32:57 +00:00
|
|
|
DROP FOREIGN KEY `levelplayer`,
|
|
|
|
DROP INDEX `leveladmin_idx`,
|
|
|
|
DROP FOREIGN KEY `leveladmin`,
|
|
|
|
DROP INDEX `levelplayer`;
|
2016-08-07 17:09:08 +00:00
|
|
|
ALTER TABLE `level`
|
2016-03-09 10:32:57 +00:00
|
|
|
CHANGE COLUMN `player` `player_id` INT(10) UNSIGNED NOT NULL,
|
|
|
|
CHANGE COLUMN `admin` `admin_id` INT(10) UNSIGNED NOT NULL;
|
2016-08-07 17:09:08 +00:00
|
|
|
ALTER TABLE `level`
|
2016-03-09 10:32:57 +00:00
|
|
|
ADD CONSTRAINT `level_player`
|
|
|
|
FOREIGN KEY (`player_id`)
|
2016-08-07 17:09:08 +00:00
|
|
|
REFERENCES `player` (`id`)
|
2016-03-09 10:32:57 +00:00
|
|
|
ON DELETE NO ACTION
|
|
|
|
ON UPDATE NO ACTION,
|
|
|
|
ADD INDEX `player_idx` (`player_id` ASC),
|
|
|
|
ADD CONSTRAINT `level_admin`
|
|
|
|
FOREIGN KEY (`admin_id`)
|
2016-08-07 17:09:08 +00:00
|
|
|
REFERENCES `player` (`id`)
|
2016-03-09 10:32:57 +00:00
|
|
|
ON DELETE NO ACTION
|
|
|
|
ON UPDATE NO ACTION,
|
|
|
|
ADD INDEX `admin_idx` (`admin_id` ASC);
|
|
|
|
|
2016-08-07 17:09:08 +00:00
|
|
|
ALTER TABLE `record`
|
2016-03-09 10:32:57 +00:00
|
|
|
DROP FOREIGN KEY `spreemap`,
|
|
|
|
DROP FOREIGN KEY `kspreeplayer`,
|
|
|
|
DROP INDEX `ksplayer_idx`;
|
2016-08-07 17:09:08 +00:00
|
|
|
ALTER TABLE `record`
|
2016-03-09 10:32:57 +00:00
|
|
|
CHANGE COLUMN `mapid` `map_id` INT(10) UNSIGNED NOT NULL,
|
|
|
|
CHANGE COLUMN `player` `player_id` INT(10) UNSIGNED NOT NULL;
|
2016-08-07 17:09:08 +00:00
|
|
|
ALTER TABLE `record`
|
2016-03-09 10:32:57 +00:00
|
|
|
ADD CONSTRAINT `record_map`
|
|
|
|
FOREIGN KEY (`map_id`)
|
2016-08-07 17:09:08 +00:00
|
|
|
REFERENCES `map` (`id`)
|
2016-03-09 10:32:57 +00:00
|
|
|
ON DELETE NO ACTION
|
|
|
|
ON UPDATE NO ACTION,
|
|
|
|
ADD CONSTRAINT `record_player`
|
|
|
|
FOREIGN KEY (`player_id`)
|
2016-08-07 17:09:08 +00:00
|
|
|
REFERENCES `player` (`id`)
|
2016-03-09 10:32:57 +00:00
|
|
|
ON DELETE NO ACTION
|
|
|
|
ON UPDATE NO ACTION,
|
|
|
|
ADD INDEX `player_idx` (`player_id` ASC);
|
|
|
|
|
2016-08-07 17:09:08 +00:00
|
|
|
ALTER TABLE `warn`
|
2016-03-09 10:32:57 +00:00
|
|
|
DROP FOREIGN KEY `warnadmin`,
|
|
|
|
DROP INDEX `invoker_idx`,
|
|
|
|
DROP FOREIGN KEY `warnplayer`,
|
|
|
|
DROP INDEX `playerid_idx`;
|
2016-08-07 17:09:08 +00:00
|
|
|
ALTER TABLE `warn`
|
2016-03-09 10:32:57 +00:00
|
|
|
CHANGE COLUMN `player` `player_id` INT(10) UNSIGNED NOT NULL,
|
|
|
|
CHANGE COLUMN `admin` `admin_id` INT(10) UNSIGNED NOT NULL;
|
2016-08-07 17:09:08 +00:00
|
|
|
ALTER TABLE `warn`
|
2016-03-09 10:32:57 +00:00
|
|
|
ADD CONSTRAINT `warn_player`
|
|
|
|
FOREIGN KEY (`player_id`)
|
2016-08-07 17:09:08 +00:00
|
|
|
REFERENCES `player` (`id`)
|
2016-03-09 10:32:57 +00:00
|
|
|
ON DELETE NO ACTION
|
|
|
|
ON UPDATE NO ACTION,
|
|
|
|
ADD INDEX `player_idx` (`player_id` ASC),
|
|
|
|
ADD CONSTRAINT `warn_admin`
|
|
|
|
FOREIGN KEY (`admin_id`)
|
2016-08-07 17:09:08 +00:00
|
|
|
REFERENCES `player` (`id`)
|
2016-03-09 10:32:57 +00:00
|
|
|
ON DELETE NO ACTION
|
|
|
|
ON UPDATE NO ACTION,
|
|
|
|
ADD INDEX `admin_idx` (`admin_id` ASC);
|