Fix for null columns in books.language crash

This commit is contained in:
Uleat 2017-01-30 03:08:00 -05:00
parent 984a009fbb
commit dc308e2ecb
4 changed files with 7 additions and 2 deletions

View File

@ -30,7 +30,7 @@
Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
*/
#define CURRENT_BINARY_DATABASE_VERSION 9102
#define CURRENT_BINARY_DATABASE_VERSION 9103
#ifdef BOTS
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9008
#else

View File

@ -356,6 +356,7 @@
9100|2016_08_27_object_display_name.sql|SHOW COLUMNS FROM `object` LIKE 'display_name'|empty|
9101|2016_12_01_pcnpc_only.sql|SHOW COLUMNS FROM `spells_new` LIKE 'pcnpc_only_flag'|empty|
9102|2017_01_10_book_languages.sql|SHOW COLUMNS FROM `books` LIKE 'language'|empty|
9103|2017_01_30_book_languages_fix.sql|SELECT `language` from `books` WHERE `language` IS NULL|not_empty|
# Upgrade conditions:
# This won't be needed after this system is implemented, but it is used database that are not

View File

@ -1,4 +1,4 @@
alter table books add language int default 0;
alter table books add language int not null default 0;
drop table if exists reading_is_fundamental;

View File

@ -0,0 +1,4 @@
UPDATE `books` SET `language` = '0' WHERE `language` IS NULL;
ALTER TABLE `books` MODIFY COLUMN `language` INT NOT NULL DEFAULT '0';