[Database] Add Primary ID Keys to Tables (#2036)

This commit is contained in:
Chris Miles 2022-03-06 20:02:33 -08:00 committed by GitHub
parent 2a5ddde78a
commit 25a19a13dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 1 deletions

View File

@ -34,7 +34,7 @@
* Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
*/
#define CURRENT_BINARY_DATABASE_VERSION 9176
#define CURRENT_BINARY_DATABASE_VERSION 9177
#ifdef BOTS
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9028

View File

@ -430,6 +430,7 @@
9174|2021_10_09_not_null_door_columns.sql|SELECT * FROM db_version WHERE version >= 9174|empty|
9175|2022_01_02_expansion_default_value_all.sql|SHOW COLUMNS FROM `forage` LIKE 'min_expansion'|contains|unsigned
9176|2022_01_10_checksum_verification.sql|SHOW COLUMNS FROM `account` LIKE 'checksum_crc1_eqgame'|empty|
9177|2022_03_06_table_structure_changes.sql|SHOW COLUMNS FROM `pets` LIKE 'id'|empty|
# Upgrade conditions:
# This won't be needed after this system is implemented, but it is used database that are not

View File

@ -0,0 +1,11 @@
ALTER TABLE `pets` DROP PRIMARY KEY;
ALTER TABLE `pets` ADD `id` int(20) PRIMARY KEY NOT NULL AUTO_INCREMENT FIRST;
CREATE UNIQUE INDEX `type_petpower` ON pets (type, petpower);
ALTER TABLE `horses` DROP PRIMARY KEY;
ALTER TABLE `horses` ADD `id` int(20) PRIMARY KEY NOT NULL AUTO_INCREMENT FIRST;
CREATE UNIQUE INDEX `filename` ON horses (filename);
ALTER TABLE books DROP INDEX `id`;
ALTER TABLE `books` ADD `id` int(20) PRIMARY KEY NOT NULL AUTO_INCREMENT FIRST;
CREATE UNIQUE INDEX `filename` ON books (name);