From 20df2abc1aca00d6aa5dc78347133890f36b32f3 Mon Sep 17 00:00:00 2001 From: Saulc Date: Sat, 13 Jan 2018 20:50:42 +0100 Subject: Initial commit --- sql-files/upgrades/2013-02-14--16-15.sql | 7 +++ sql-files/upgrades/2013-02-15--18-06.sql | 3 + sql-files/upgrades/2013-03-05--01-05.sql | 3 + sql-files/upgrades/2013-03-06--00-00.sql | 9 +++ sql-files/upgrades/2013-03-09--01-56.sql | 4 ++ sql-files/upgrades/2013-03-27--18-35.sql | 3 + sql-files/upgrades/2013-04-16--01-24.sql | 3 + sql-files/upgrades/2013-04-16--02-15.sql | 4 ++ sql-files/upgrades/2013-10-09--21-38.sql | 3 + sql-files/upgrades/2013-10-10--16-36.sql | 7 +++ sql-files/upgrades/2013-10-27--16-47.sql | 6 ++ sql-files/upgrades/2013-10-30--19-53.sql | 5 ++ sql-files/upgrades/2013-10-30--21-12.sql | 3 + sql-files/upgrades/2013-10-31--07-49.sql | 6 ++ sql-files/upgrades/2013-11-09--00-03.sql | 5 ++ sql-files/upgrades/2013-11-15--00-06.sql | 105 +++++++++++++++++++++++++++++++ sql-files/upgrades/2013-11-15--19-57.sql | 5 ++ sql-files/upgrades/2013-11-16--07-49.sql | 3 + sql-files/upgrades/2013-11-18--08-23.sql | 65 +++++++++++++++++++ sql-files/upgrades/2013-12-24--00-15.sql | 8 +++ sql-files/upgrades/2014-01-04--16-47.sql | 61 ++++++++++++++++++ sql-files/upgrades/2014-01-06--17-22.sql | 16 +++++ sql-files/upgrades/2014-02-19--17-57.sql | 4 ++ sql-files/upgrades/2014-03-25--23-57.sql | 3 + sql-files/upgrades/2014-04-07--22-04.sql | 3 + sql-files/upgrades/2014-04-26--10-00.sql | 3 + sql-files/upgrades/2014-05-17--00-06.sql | 3 + sql-files/upgrades/2014-09-01--16-53.sql | 5 ++ sql-files/upgrades/2014-11-03--00-45.sql | 3 + sql-files/upgrades/2015-07-08--13-08.sql | 6 ++ sql-files/upgrades/2015-08-27--20-42.sql | 3 + sql-files/upgrades/2015-12-16--12-57.sql | 26 ++++++++ sql-files/upgrades/2015-12-17--15-58.sql | 22 +++++++ sql-files/upgrades/2016-03-10--22-18.sql | 22 +++++++ sql-files/upgrades/2016-07-08--02-42.sql | 35 +++++++++++ sql-files/upgrades/2016-07-08--02-51.sql | 30 +++++++++ sql-files/upgrades/2016-10-03--20-27.sql | 23 +++++++ sql-files/upgrades/2016-10-26--10-29.sql | 23 +++++++ sql-files/upgrades/2017-03-02--11-40.sql | 93 +++++++++++++++++++++++++++ sql-files/upgrades/2017-03-05--08-09.sql | 15 +++++ sql-files/upgrades/2017-03-15--14-29.sql | 74 ++++++++++++++++++++++ sql-files/upgrades/2017-11-04--10-39.sql | 6 ++ sql-files/upgrades/index.txt | 42 +++++++++++++ 43 files changed, 778 insertions(+) create mode 100644 sql-files/upgrades/2013-02-14--16-15.sql create mode 100644 sql-files/upgrades/2013-02-15--18-06.sql create mode 100644 sql-files/upgrades/2013-03-05--01-05.sql create mode 100644 sql-files/upgrades/2013-03-06--00-00.sql create mode 100644 sql-files/upgrades/2013-03-09--01-56.sql create mode 100644 sql-files/upgrades/2013-03-27--18-35.sql create mode 100644 sql-files/upgrades/2013-04-16--01-24.sql create mode 100644 sql-files/upgrades/2013-04-16--02-15.sql create mode 100644 sql-files/upgrades/2013-10-09--21-38.sql create mode 100644 sql-files/upgrades/2013-10-10--16-36.sql create mode 100644 sql-files/upgrades/2013-10-27--16-47.sql create mode 100644 sql-files/upgrades/2013-10-30--19-53.sql create mode 100644 sql-files/upgrades/2013-10-30--21-12.sql create mode 100644 sql-files/upgrades/2013-10-31--07-49.sql create mode 100644 sql-files/upgrades/2013-11-09--00-03.sql create mode 100644 sql-files/upgrades/2013-11-15--00-06.sql create mode 100644 sql-files/upgrades/2013-11-15--19-57.sql create mode 100644 sql-files/upgrades/2013-11-16--07-49.sql create mode 100644 sql-files/upgrades/2013-11-18--08-23.sql create mode 100644 sql-files/upgrades/2013-12-24--00-15.sql create mode 100644 sql-files/upgrades/2014-01-04--16-47.sql create mode 100644 sql-files/upgrades/2014-01-06--17-22.sql create mode 100644 sql-files/upgrades/2014-02-19--17-57.sql create mode 100644 sql-files/upgrades/2014-03-25--23-57.sql create mode 100644 sql-files/upgrades/2014-04-07--22-04.sql create mode 100644 sql-files/upgrades/2014-04-26--10-00.sql create mode 100644 sql-files/upgrades/2014-05-17--00-06.sql create mode 100644 sql-files/upgrades/2014-09-01--16-53.sql create mode 100644 sql-files/upgrades/2014-11-03--00-45.sql create mode 100644 sql-files/upgrades/2015-07-08--13-08.sql create mode 100644 sql-files/upgrades/2015-08-27--20-42.sql create mode 100644 sql-files/upgrades/2015-12-16--12-57.sql create mode 100644 sql-files/upgrades/2015-12-17--15-58.sql create mode 100644 sql-files/upgrades/2016-03-10--22-18.sql create mode 100644 sql-files/upgrades/2016-07-08--02-42.sql create mode 100644 sql-files/upgrades/2016-07-08--02-51.sql create mode 100644 sql-files/upgrades/2016-10-03--20-27.sql create mode 100644 sql-files/upgrades/2016-10-26--10-29.sql create mode 100644 sql-files/upgrades/2017-03-02--11-40.sql create mode 100644 sql-files/upgrades/2017-03-05--08-09.sql create mode 100644 sql-files/upgrades/2017-03-15--14-29.sql create mode 100644 sql-files/upgrades/2017-11-04--10-39.sql create mode 100644 sql-files/upgrades/index.txt (limited to 'sql-files/upgrades') diff --git a/sql-files/upgrades/2013-02-14--16-15.sql b/sql-files/upgrades/2013-02-14--16-15.sql new file mode 100644 index 000000000..b7db70d43 --- /dev/null +++ b/sql-files/upgrades/2013-02-14--16-15.sql @@ -0,0 +1,7 @@ +#1360858500 +CREATE TABLE IF NOT EXISTS `sql_updates` ( + `timestamp` INT(11) UNSIGNED NOT NULL, + `ignored` ENUM('Yes','No') NOT NULL DEFAULT 'No' +) ENGINE=MyISAM; +ALTER TABLE `skill` ADD COLUMN `flag` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0; +INSERT INTO `sql_updates` (`timestamp`) VALUES (1360858500); diff --git a/sql-files/upgrades/2013-02-15--18-06.sql b/sql-files/upgrades/2013-02-15--18-06.sql new file mode 100644 index 000000000..efb0b2ad6 --- /dev/null +++ b/sql-files/upgrades/2013-02-15--18-06.sql @@ -0,0 +1,3 @@ +#1360951560 +ALTER TABLE `sql_updates` ADD PRIMARY KEY (`timestamp`); +INSERT INTO `sql_updates` (`timestamp`) VALUES (1360951560); diff --git a/sql-files/upgrades/2013-03-05--01-05.sql b/sql-files/upgrades/2013-03-05--01-05.sql new file mode 100644 index 000000000..b1a0e4029 --- /dev/null +++ b/sql-files/upgrades/2013-03-05--01-05.sql @@ -0,0 +1,3 @@ +#1362445531 +ALTER TABLE `login` ADD `character_slots` TINYINT(3) UNSIGNED NOT NULL; +INSERT INTO `sql_updates` (`timestamp`) VALUES (1362445531); diff --git a/sql-files/upgrades/2013-03-06--00-00.sql b/sql-files/upgrades/2013-03-06--00-00.sql new file mode 100644 index 000000000..8d46be76a --- /dev/null +++ b/sql-files/upgrades/2013-03-06--00-00.sql @@ -0,0 +1,9 @@ +#1362528000 +-- This script resets all dewata quests that were done by your users before this revision +-- Author: Euphy +DELETE FROM `quest` WHERE `quest_id` > 5034 AND `quest_id` < 5055; +DELETE FROM `quest` WHERE `quest_id` > 9154 AND `quest_id` < 9166; +DELETE FROM `global_reg_value` WHERE `str` = 'dewata_gatti'; +DELETE FROM `global_reg_value` WHERE `str` = 'dewata_legend'; +DELETE FROM `global_reg_value` WHERE `str` = 'dewata_oldman'; +INSERT INTO `sql_updates` (`timestamp`) VALUES (1362528000); diff --git a/sql-files/upgrades/2013-03-09--01-56.sql b/sql-files/upgrades/2013-03-09--01-56.sql new file mode 100644 index 000000000..6edfa79c9 --- /dev/null +++ b/sql-files/upgrades/2013-03-09--01-56.sql @@ -0,0 +1,4 @@ +#1362794218 +ALTER TABLE `login` ADD COLUMN `pincode` VARCHAR(4) NOT NULL DEFAULT ''; +ALTER TABLE `login` ADD COLUMN `pincode_change` INT(11) unsigned NOT NULL DEFAULT '0'; +INSERT INTO `sql_updates` (`timestamp`) VALUES (1362794218); diff --git a/sql-files/upgrades/2013-03-27--18-35.sql b/sql-files/upgrades/2013-03-27--18-35.sql new file mode 100644 index 000000000..323aa2ace --- /dev/null +++ b/sql-files/upgrades/2013-03-27--18-35.sql @@ -0,0 +1,3 @@ +#1364409316 +ALTER TABLE `char` ADD COLUMN `slotchange` SMALLINT(3) unsigned NOT NULL default '0'; +INSERT INTO `sql_updates` (`timestamp`) VALUES (1364409316); diff --git a/sql-files/upgrades/2013-04-16--01-24.sql b/sql-files/upgrades/2013-04-16--01-24.sql new file mode 100644 index 000000000..951ca8cd2 --- /dev/null +++ b/sql-files/upgrades/2013-04-16--01-24.sql @@ -0,0 +1,3 @@ +#1366075474 +-- Info http://herc.ws/board/topic/410-skill-script-command-updatefix/ +UPDATE `skill` SET `flag` = 0 WHERE `flag` = 4 AND `id` != 2535 AND `id` != 681; diff --git a/sql-files/upgrades/2013-04-16--02-15.sql b/sql-files/upgrades/2013-04-16--02-15.sql new file mode 100644 index 000000000..458d1dc37 --- /dev/null +++ b/sql-files/upgrades/2013-04-16--02-15.sql @@ -0,0 +1,4 @@ +#1366078541 +ALTER TABLE `char` ADD `char_opt` INT(11) UNSIGNED NOT NULL DEFAULT '0'; +INSERT INTO `sql_updates` (`timestamp`) VALUES (1366075474); -- for the previous that missed it.. +INSERT INTO `sql_updates` (`timestamp`) VALUES (1366078541); diff --git a/sql-files/upgrades/2013-10-09--21-38.sql b/sql-files/upgrades/2013-10-09--21-38.sql new file mode 100644 index 000000000..d8854bcdf --- /dev/null +++ b/sql-files/upgrades/2013-10-09--21-38.sql @@ -0,0 +1,3 @@ +#1381354728 +ALTER TABLE `zenylog` MODIFY `type` ENUM('T','V','P','M','S','N','D','C','A','E','I','B','K') NOT NULL DEFAULT 'S'; +INSERT INTO `sql_updates` (`timestamp`) VALUES (1381354728); diff --git a/sql-files/upgrades/2013-10-10--16-36.sql b/sql-files/upgrades/2013-10-10--16-36.sql new file mode 100644 index 000000000..88db7609e --- /dev/null +++ b/sql-files/upgrades/2013-10-10--16-36.sql @@ -0,0 +1,7 @@ +#1381423003 +CREATE TABLE IF NOT EXISTS `account_data` ( + `account_id` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `bank_vault` INT(11) UNSIGNED NOT NULL DEFAULT '0', + PRIMARY KEY (`account_id`) +) ENGINE=MyISAM; +INSERT INTO `sql_updates` (`timestamp`) VALUES (1381423003); diff --git a/sql-files/upgrades/2013-10-27--16-47.sql b/sql-files/upgrades/2013-10-27--16-47.sql new file mode 100644 index 000000000..2a9a73f31 --- /dev/null +++ b/sql-files/upgrades/2013-10-27--16-47.sql @@ -0,0 +1,6 @@ +#1382892428 +ALTER TABLE `inventory` MODIFY `equip` INT(11) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `storage` MODIFY `equip` INT(11) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `cart_inventory` MODIFY `equip` INT(11) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `guild_storage` MODIFY `equip` INT(11) UNSIGNED NOT NULL DEFAULT '0'; +INSERT INTO `sql_updates` (`timestamp`) VALUES (1382892428); diff --git a/sql-files/upgrades/2013-10-30--19-53.sql b/sql-files/upgrades/2013-10-30--19-53.sql new file mode 100644 index 000000000..6e89015e9 --- /dev/null +++ b/sql-files/upgrades/2013-10-30--19-53.sql @@ -0,0 +1,5 @@ +#1383162785 +ALTER TABLE `account_data` ADD `base_exp` TINYINT(4) UNSIGNED NOT NULL DEFAULT '100'; +ALTER TABLE `account_data` ADD `base_drop` TINYINT(4) UNSIGNED NOT NULL DEFAULT '100'; +ALTER TABLE `account_data` ADD `base_death` TINYINT(4) UNSIGNED NOT NULL DEFAULT '100'; +INSERT INTO `sql_updates` (`timestamp`) VALUES (1383162785); diff --git a/sql-files/upgrades/2013-10-30--21-12.sql b/sql-files/upgrades/2013-10-30--21-12.sql new file mode 100644 index 000000000..e0fbda874 --- /dev/null +++ b/sql-files/upgrades/2013-10-30--21-12.sql @@ -0,0 +1,3 @@ +#1383167577 +ALTER TABLE `char` ADD `font` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0'; +INSERT INTO `sql_updates` (`timestamp`) VALUES (1383167577); diff --git a/sql-files/upgrades/2013-10-31--07-49.sql b/sql-files/upgrades/2013-10-31--07-49.sql new file mode 100644 index 000000000..25f489f57 --- /dev/null +++ b/sql-files/upgrades/2013-10-31--07-49.sql @@ -0,0 +1,6 @@ +#1383205740 +ALTER TABLE `inventory` ADD COLUMN `bound` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' AFTER `favorite`; +ALTER TABLE `cart_inventory` ADD COLUMN `bound` TINYINT(1) UNSIGNED NOT NULL default '0' AFTER `expire_time`; +ALTER TABLE `storage` ADD COLUMN `bound` TINYINT(1) UNSIGNED NOT NULL default '0' AFTER `expire_time`; +ALTER TABLE `guild_storage` ADD COLUMN `bound` TINYINT(1) UNSIGNED NOT NULL default '0' AFTER `expire_time`; +INSERT INTO `sql_updates` (`timestamp`) VALUES (1383205740); diff --git a/sql-files/upgrades/2013-11-09--00-03.sql b/sql-files/upgrades/2013-11-09--00-03.sql new file mode 100644 index 000000000..92fe1b76b --- /dev/null +++ b/sql-files/upgrades/2013-11-09--00-03.sql @@ -0,0 +1,5 @@ +#1383955424 +ALTER TABLE `account_data` MODIFY `base_exp` TINYINT(4) UNSIGNED NOT NULL DEFAULT '100'; +ALTER TABLE `account_data` MODIFY `base_drop` TINYINT(4) UNSIGNED NOT NULL DEFAULT '100'; +ALTER TABLE `account_data` MODIFY `base_death` TINYINT(4) UNSIGNED NOT NULL DEFAULT '100'; +INSERT INTO `sql_updates` (`timestamp`) VALUES (1383955424); diff --git a/sql-files/upgrades/2013-11-15--00-06.sql b/sql-files/upgrades/2013-11-15--00-06.sql new file mode 100644 index 000000000..dafc5615a --- /dev/null +++ b/sql-files/upgrades/2013-11-15--00-06.sql @@ -0,0 +1,105 @@ +#1384473995 + +-- Note: If you're running a MySQL version earlier than 5.0 (or if this scripts fails for you for any reason) +-- you'll need to run the following queries manually: +-- +-- [ Pre-Renewal only ] +-- ALTER TABLE item_db2 ADD COLUMN `matk` SMALLINT(5) UNSIGNED DEFAULT NULL AFTER atk; +-- ALTER TABLE item_db2 CHANGE COLUMN `equip_level` `equip_level_min` SMALLINT(5) UNSIGNED DEFAULT NULL; +-- ALTER TABLE item_db2 ADD COLUMN `equip_level_max` SMALLINT(5) UNSIGNED DEFAULT NULL AFTER equip_level_min; +-- [ Both Pre-Renewal and Renewal ] +-- ALTER TABLE item_db2 MODIFY COLUMN `price_buy` MEDIUMINT(10) DEFAULT NULL; +-- ALTER TABLE item_db2 MODIFY COLUMN `price_sell` MEDIUMINT(10) DEFAULT NULL; +-- ALTER TABLE item_db2 MODIFY COLUMN `weight` SMALLINT(5) UNSIGNED DEFAULT NULL; +-- ALTER TABLE item_db2 MODIFY COLUMN `atk` SMALLINT(5) UNSIGNED DEFAULT NULL; +-- ALTER TABLE item_db2 MODIFY COLUMN `matk` SMALLINT(5) UNSIGNED DEFAULT NULL; +-- ALTER TABLE item_db2 MODIFY COLUMN `defence` SMALLINT(5) UNSIGNED DEFAULT NULL; +-- ALTER TABLE item_db2 MODIFY COLUMN `range` TINYINT(2) UNSIGNED DEFAULT NULL; +-- ALTER TABLE item_db2 MODIFY COLUMN `slots` TINYINT(2) UNSIGNED DEFAULT NULL; +-- ALTER TABLE item_db2 MODIFY COLUMN `equip_jobs` INT(12) UNSIGNED DEFAULT NULL; +-- ALTER TABLE item_db2 MODIFY COLUMN `equip_upper` TINYINT(8) UNSIGNED DEFAULT NULL; +-- ALTER TABLE item_db2 MODIFY COLUMN `equip_genders` TINYINT(2) UNSIGNED DEFAULT NULL; +-- ALTER TABLE item_db2 MODIFY COLUMN `equip_locations` SMALLINT(4) UNSIGNED DEFAULT NULL; +-- ALTER TABLE item_db2 MODIFY COLUMN `weapon_level` TINYINT(2) UNSIGNED DEFAULT NULL; +-- ALTER TABLE item_db2 MODIFY COLUMN `equip_level_min` SMALLINT(5) UNSIGNED DEFAULT NULL; +-- ALTER TABLE item_db2 MODIFY COLUMN `equip_level_max` SMALLINT(5) UNSIGNED DEFAULT NULL; +-- ALTER TABLE item_db2 MODIFY COLUMN `refineable` TINYINT(1) UNSIGNED DEFAULT NULL; +-- ALTER TABLE item_db2 MODIFY COLUMN `view` SMALLINT(3) UNSIGNED DEFAULT NULL; +-- INSERT INTO `sql_updates` (`timestamp`) VALUES (1384473995); +-- +-- [ End ] +-- What follows is the automated script that does all of the above. + +DELIMITER $$ + +DROP PROCEDURE IF EXISTS alter_if_not_exists $$ +DROP PROCEDURE IF EXISTS alter_if_exists $$ + +CREATE PROCEDURE alter_if_not_exists(my_table TINYTEXT, my_column TINYTEXT, my_command TINYTEXT, my_predicate TEXT) +BEGIN + set @dbname = DATABASE(); + IF EXISTS ( + SELECT * FROM information_schema.TABLES + WHERE TABLE_SCHEMA = @dbname + AND TABLE_NAME = my_table + ) AND NOT EXISTS ( + SELECT * FROM information_schema.COLUMNS + WHERE TABLE_SCHEMA = @dbname + AND TABLE_NAME = my_table + AND COLUMN_NAME = my_column + ) + THEN + SET @q = CONCAT('ALTER TABLE ', @dbname, '.', my_table, ' ', + my_command, ' `', my_column, '` ', my_predicate); + PREPARE STMT FROM @q; + EXECUTE STMT; + END IF; + +END $$ + +CREATE PROCEDURE alter_if_exists(my_table TINYTEXT, my_column TINYTEXT, my_command TINYTEXT, my_predicate TEXT) +BEGIN + set @dbname = DATABASE(); + IF EXISTS ( + SELECT * FROM information_schema.COLUMNS + WHERE TABLE_SCHEMA = @dbname + AND TABLE_NAME = my_table + AND COLUMN_NAME = my_column + ) + THEN + SET @q = CONCAT('ALTER TABLE ', @dbname, '.', my_table, ' ', + my_command, ' `', my_column, '` ', my_predicate); + PREPARE STMT FROM @q; + EXECUTE STMT; + END IF; + +END $$ + +CALL alter_if_not_exists('item_db2', 'matk', 'ADD COLUMN', 'SMALLINT(5) UNSIGNED DEFAULT NULL AFTER atk') $$ +CALL alter_if_exists('item_db2', 'equip_level', 'CHANGE COLUMN', 'equip_level_min SMALLINT(5) UNSIGNED DEFAULT NULL') $$ +CALL alter_if_not_exists('item_db2', 'equip_level_max', 'ADD COLUMN', 'SMALLINT(5) UNSIGNED DEFAULT NULL AFTER equip_level_min') $$ + +CALL alter_if_exists('item_db2', 'price_buy', 'MODIFY COLUMN', 'MEDIUMINT(10) DEFAULT NULL') $$ +CALL alter_if_exists('item_db2', 'price_sell', 'MODIFY COLUMN', 'MEDIUMINT(10) DEFAULT NULL') $$ +CALL alter_if_exists('item_db2', 'weight', 'MODIFY COLUMN', 'SMALLINT(5) UNSIGNED DEFAULT NULL') $$ +CALL alter_if_exists('item_db2', 'atk', 'MODIFY COLUMN', 'SMALLINT(5) UNSIGNED DEFAULT NULL') $$ +CALL alter_if_exists('item_db2', 'matk', 'MODIFY COLUMN', 'SMALLINT(5) UNSIGNED DEFAULT NULL') $$ +CALL alter_if_exists('item_db2', 'defence', 'MODIFY COLUMN', 'SMALLINT(5) UNSIGNED DEFAULT NULL') $$ +CALL alter_if_exists('item_db2', 'range', 'MODIFY COLUMN', 'TINYINT(2) UNSIGNED DEFAULT NULL') $$ +CALL alter_if_exists('item_db2', 'slots', 'MODIFY COLUMN', 'TINYINT(2) UNSIGNED DEFAULT NULL') $$ +CALL alter_if_exists('item_db2', 'equip_jobs', 'MODIFY COLUMN', 'INT(12) UNSIGNED DEFAULT NULL') $$ +CALL alter_if_exists('item_db2', 'equip_upper', 'MODIFY COLUMN', 'TINYINT(8) UNSIGNED DEFAULT NULL') $$ +CALL alter_if_exists('item_db2', 'equip_genders', 'MODIFY COLUMN', 'TINYINT(2) UNSIGNED DEFAULT NULL') $$ +CALL alter_if_exists('item_db2', 'equip_locations', 'MODIFY COLUMN', 'SMALLINT(4) UNSIGNED DEFAULT NULL') $$ +CALL alter_if_exists('item_db2', 'weapon_level', 'MODIFY COLUMN', 'TINYINT(2) UNSIGNED DEFAULT NULL') $$ +CALL alter_if_exists('item_db2', 'equip_level_min', 'MODIFY COLUMN', 'SMALLINT(5) UNSIGNED DEFAULT NULL') $$ +CALL alter_if_exists('item_db2', 'equip_level_max', 'MODIFY COLUMN', 'SMALLINT(5) UNSIGNED DEFAULT NULL') $$ +CALL alter_if_exists('item_db2', 'refineable', 'MODIFY COLUMN', 'TINYINT(1) UNSIGNED DEFAULT NULL') $$ +CALL alter_if_exists('item_db2', 'view', 'MODIFY COLUMN', 'SMALLINT(3) UNSIGNED DEFAULT NULL') $$ + +DROP PROCEDURE IF EXISTS alter_if_not_exists $$ +DROP PROCEDURE IF EXISTS alter_if_exists $$ + +DELIMITER ';' + +INSERT INTO `sql_updates` (`timestamp`) VALUES (1384473995); diff --git a/sql-files/upgrades/2013-11-15--19-57.sql b/sql-files/upgrades/2013-11-15--19-57.sql new file mode 100644 index 000000000..d4d8ec501 --- /dev/null +++ b/sql-files/upgrades/2013-11-15--19-57.sql @@ -0,0 +1,5 @@ +#1384545461 +UPDATE `account_data` SET `base_exp` = '100' WHERE `base_exp` = '0'; +UPDATE `account_data` SET `base_drop` = '100' WHERE `base_drop` = '0'; +UPDATE `account_data` SET `base_death` = '100' WHERE `base_death` = '0'; +INSERT INTO `sql_updates` (`timestamp`) VALUES (1384545461); diff --git a/sql-files/upgrades/2013-11-16--07-49.sql b/sql-files/upgrades/2013-11-16--07-49.sql new file mode 100644 index 000000000..fce74aab1 --- /dev/null +++ b/sql-files/upgrades/2013-11-16--07-49.sql @@ -0,0 +1,3 @@ +#1384588175 +ALTER TABLE `char` ADD COLUMN `unban_time` INT(11) UNSIGNED NOT NULL DEFAULT '0'; +INSERT INTO `sql_updates` (`timestamp`) VALUES (1384588175); diff --git a/sql-files/upgrades/2013-11-18--08-23.sql b/sql-files/upgrades/2013-11-18--08-23.sql new file mode 100644 index 000000000..d7100d78a --- /dev/null +++ b/sql-files/upgrades/2013-11-18--08-23.sql @@ -0,0 +1,65 @@ +#1384763034 + +-- Note: If you're running a MySQL version earlier than 5.0 (or if this scripts fails for you for any reason) +-- you'll need to run the following queries manually: +-- +-- [ Both Pre-Renewal and Renewal ] +-- ALTER TABLE item_db2 ADD COLUMN `bindonequip` TINYINT(1) UNSIGNED DEFAULT NULL AFTER `view`; +-- INSERT INTO `sql_updates` (`timestamp`) VALUES (1384763034); +-- +-- [ End ] +-- What follows is the automated script that does all of the above. + +DELIMITER $$ + +DROP PROCEDURE IF EXISTS alter_if_not_exists $$ +DROP PROCEDURE IF EXISTS alter_if_exists $$ + +CREATE PROCEDURE alter_if_not_exists(my_table TINYTEXT, my_column TINYTEXT, my_command TINYTEXT, my_predicate TEXT) +BEGIN + set @dbname = DATABASE(); + IF EXISTS ( + SELECT * FROM information_schema.TABLES + WHERE TABLE_SCHEMA = @dbname + AND TABLE_NAME = my_table + ) AND NOT EXISTS ( + SELECT * FROM information_schema.COLUMNS + WHERE TABLE_SCHEMA = @dbname + AND TABLE_NAME = my_table + AND COLUMN_NAME = my_column + ) + THEN + SET @q = CONCAT('ALTER TABLE ', @dbname, '.', my_table, ' ', + my_command, ' `', my_column, '` ', my_predicate); + PREPARE STMT FROM @q; + EXECUTE STMT; + END IF; + +END $$ + +CREATE PROCEDURE alter_if_exists(my_table TINYTEXT, my_column TINYTEXT, my_command TINYTEXT, my_predicate TEXT) +BEGIN + set @dbname = DATABASE(); + IF EXISTS ( + SELECT * FROM information_schema.COLUMNS + WHERE TABLE_SCHEMA = @dbname + AND TABLE_NAME = my_table + AND COLUMN_NAME = my_column + ) + THEN + SET @q = CONCAT('ALTER TABLE ', @dbname, '.', my_table, ' ', + my_command, ' `', my_column, '` ', my_predicate); + PREPARE STMT FROM @q; + EXECUTE STMT; + END IF; + +END $$ + +CALL alter_if_not_exists('item_db2', 'bindonequip', 'ADD COLUMN', 'TINYINT(1) UNSIGNED DEFAULT NULL AFTER `view`') $$ + +DROP PROCEDURE IF EXISTS alter_if_not_exists $$ +DROP PROCEDURE IF EXISTS alter_if_exists $$ + +DELIMITER ';' + +INSERT INTO `sql_updates` (`timestamp`) VALUES (1384763034); diff --git a/sql-files/upgrades/2013-12-24--00-15.sql b/sql-files/upgrades/2013-12-24--00-15.sql new file mode 100644 index 000000000..2de4771a6 --- /dev/null +++ b/sql-files/upgrades/2013-12-24--00-15.sql @@ -0,0 +1,8 @@ +#1387844126 +CREATE TABLE IF NOT EXISTS `npc_market_data` ( + `name` VARCHAR(24) NOT NULL DEFAULT '', + `itemid` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `amount` INT(11) UNSIGNED NOT NULL DEFAULT '0', + PRIMARY KEY (`name`,`itemid`) +) ENGINE=MyISAM; +INSERT INTO `sql_updates` (`timestamp`) VALUES (1387844126); diff --git a/sql-files/upgrades/2014-01-04--16-47.sql b/sql-files/upgrades/2014-01-04--16-47.sql new file mode 100644 index 000000000..40be437d9 --- /dev/null +++ b/sql-files/upgrades/2014-01-04--16-47.sql @@ -0,0 +1,61 @@ +#1388854043 +ALTER TABLE `mapreg` ADD PRIMARY KEY (`varname`, `index`); +ALTER TABLE `mapreg` DROP INDEX `varname`; +ALTER TABLE `mapreg` DROP INDEX `index`; +ALTER TABLE `mapreg` MODIFY `varname` VARCHAR(32) BINARY NOT NULL; +CREATE TABLE IF NOT EXISTS `acc_reg_num_db` ( + `account_id` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `key` VARCHAR(32) BINARY NOT NULL DEFAULT '', + `index` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `value` INT(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`account_id`,`key`,`index`), + KEY `account_id` (`account_id`) +) ENGINE=MyISAM; +CREATE TABLE IF NOT EXISTS `acc_reg_str_db` ( + `account_id` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `key` VARCHAR(32) BINARY NOT NULL DEFAULT '', + `index` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `value` VARCHAR(254) NOT NULL DEFAULT '0', + PRIMARY KEY (`account_id`,`key`,`index`), + KEY `account_id` (`account_id`) +) ENGINE=MyISAM; +CREATE TABLE IF NOT EXISTS `char_reg_num_db` ( + `char_id` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `key` VARCHAR(32) BINARY NOT NULL DEFAULT '', + `index` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `value` INT(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`char_id`,`key`,`index`), + KEY `char_id` (`char_id`) +) ENGINE=MyISAM; +CREATE TABLE IF NOT EXISTS `char_reg_str_db` ( + `char_id` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `key` VARCHAR(32) BINARY NOT NULL DEFAULT '', + `index` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `value` VARCHAR(254) NOT NULL DEFAULT '0', + PRIMARY KEY (`char_id`,`key`,`index`), + KEY `char_id` (`char_id`) +) ENGINE=MyISAM; +CREATE TABLE IF NOT EXISTS `global_acc_reg_num_db` ( + `account_id` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `key` VARCHAR(32) BINARY NOT NULL DEFAULT '', + `index` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `value` INT(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`account_id`,`key`,`index`), + KEY `account_id` (`account_id`) +) ENGINE=MyISAM; +CREATE TABLE IF NOT EXISTS `global_acc_reg_str_db` ( + `account_id` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `key` VARCHAR(32) BINARY NOT NULL DEFAULT '', + `index` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `value` VARCHAR(254) NOT NULL DEFAULT '0', + PRIMARY KEY (`account_id`,`key`,`index`), + KEY `account_id` (`account_id`) +) ENGINE=MyISAM; +INSERT INTO `acc_reg_num_db` (`account_id`, `key`, `index`, `value`) SELECT `account_id`, `str`, 0, `value` FROM `global_reg_value` WHERE `type` = 2 AND `str` NOT LIKE '%$'; +INSERT INTO `acc_reg_str_db` (`account_id`, `key`, `index`, `value`) SELECT `account_id`, `str`, 0, `value` FROM `global_reg_value` WHERE `type` = 2 AND `str` LIKE '%$'; +INSERT INTO `char_reg_num_db` (`char_id`, `key`, `index`, `value`) SELECT `char_id`, `str`, 0, `value` FROM `global_reg_value` WHERE `type` = 3 AND `str` NOT LIKE '%$'; +INSERT INTO `char_reg_str_db` (`char_id`, `key`, `index`, `value`) SELECT `char_id`, `str`, 0, `value` FROM `global_reg_value` WHERE `type` = 3 AND `str` LIKE '%$'; +INSERT INTO `global_acc_reg_num_db` (`account_id`, `key`, `index`, `value`) SELECT `account_id`, `str`, 0, `value` FROM `global_reg_value` WHERE `type` = 1 AND `str` NOT LIKE '%$'; +INSERT INTO `global_acc_reg_str_db` (`account_id`, `key`, `index`, `value`) SELECT `account_id`, `str`, 0, `value` FROM `global_reg_value` WHERE `type` = 1 AND `str` LIKE '%$'; +# DROP TABLE `global_reg_value`; +INSERT INTO `sql_updates` (`timestamp`) VALUES (1388854043); diff --git a/sql-files/upgrades/2014-01-06--17-22.sql b/sql-files/upgrades/2014-01-06--17-22.sql new file mode 100644 index 000000000..e3ca8935e --- /dev/null +++ b/sql-files/upgrades/2014-01-06--17-22.sql @@ -0,0 +1,16 @@ +#1389028967 +CREATE TABLE IF NOT EXISTS `autotrade_merchants` ( + `account_id` INT(11) NOT NULL DEFAULT '0', + `char_id` INT(11) NOT NULL DEFAULT '0', + `sex` TINYINT(2) NOT NULL DEFAULT '0', + `title` varchar(80) NOT NULL DEFAULT 'Buy From Me!', + PRIMARY KEY (`account_id`,`char_id`) +) ENGINE=MyISAM; +CREATE TABLE IF NOT EXISTS `autotrade_data` ( + `char_id` INT(11) NOT NULL DEFAULT '0', + `itemkey` INT(11) NOT NULL DEFAULT '0', + `amount` INT(11) NOT NULL DEFAULT '0', + `price` INT(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`char_id`,`itemkey`) +) ENGINE=MyISAM; +INSERT INTO `sql_updates` (`timestamp`) VALUES (1389028967); diff --git a/sql-files/upgrades/2014-02-19--17-57.sql b/sql-files/upgrades/2014-02-19--17-57.sql new file mode 100644 index 000000000..63abc335f --- /dev/null +++ b/sql-files/upgrades/2014-02-19--17-57.sql @@ -0,0 +1,4 @@ +#1392832626 +DELETE FROM `sc_data` WHERE `tick` = '-1'; +ALTER TABLE `sc_data` ADD PRIMARY KEY (`account_id`,`char_id`,`type`); +INSERT INTO `sql_updates` (`timestamp`) VALUES (1392832626); diff --git a/sql-files/upgrades/2014-03-25--23-57.sql b/sql-files/upgrades/2014-03-25--23-57.sql new file mode 100644 index 000000000..40d3fb2fc --- /dev/null +++ b/sql-files/upgrades/2014-03-25--23-57.sql @@ -0,0 +1,3 @@ +#1395789302 +ALTER TABLE `charlog` ADD COLUMN `char_id` INT(11) UNSIGNED NOT NULL DEFAULT '0' AFTER `account_id`; +INSERT INTO `sql_updates` (`timestamp`) VALUES (1395789302); diff --git a/sql-files/upgrades/2014-04-07--22-04.sql b/sql-files/upgrades/2014-04-07--22-04.sql new file mode 100644 index 000000000..56c54eac4 --- /dev/null +++ b/sql-files/upgrades/2014-04-07--22-04.sql @@ -0,0 +1,3 @@ +#1396893866 +ALTER TABLE `char` ADD COLUMN `uniqueitem_counter` BIGINT(20) NOT NULL AFTER `unban_time`; +INSERT INTO `sql_updates` (`timestamp`) VALUES (1396893866); diff --git a/sql-files/upgrades/2014-04-26--10-00.sql b/sql-files/upgrades/2014-04-26--10-00.sql new file mode 100644 index 000000000..0c0b571e0 --- /dev/null +++ b/sql-files/upgrades/2014-04-26--10-00.sql @@ -0,0 +1,3 @@ +#1398477600 +ALTER TABLE `char` CHANGE COLUMN `uniqueitem_counter` `uniqueitem_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; +INSERT INTO `sql_updates` (`timestamp`) VALUES (1398477600); diff --git a/sql-files/upgrades/2014-05-17--00-06.sql b/sql-files/upgrades/2014-05-17--00-06.sql new file mode 100644 index 000000000..4e5d0d32a --- /dev/null +++ b/sql-files/upgrades/2014-05-17--00-06.sql @@ -0,0 +1,3 @@ +#1400256139 +ALTER TABLE `pet` CHANGE `incuvate` `incubate` int(11) unsigned NOT NULL default '0'; +INSERT INTO `sql_updates` (`timestamp`) VALUES (1400256139); diff --git a/sql-files/upgrades/2014-09-01--16-53.sql b/sql-files/upgrades/2014-09-01--16-53.sql new file mode 100644 index 000000000..9827c002d --- /dev/null +++ b/sql-files/upgrades/2014-09-01--16-53.sql @@ -0,0 +1,5 @@ +#1409590380 +ALTER TABLE `account_data` CHANGE `base_exp` `base_exp` SMALLINT(6) UNSIGNED NOT NULL DEFAULT '100', +CHANGE `base_drop` `base_drop` SMALLINT(6) UNSIGNED NOT NULL DEFAULT '100', +CHANGE `base_death` `base_death` SMALLINT(6) UNSIGNED NOT NULL DEFAULT '100'; +INSERT INTO `sql_updates` (`timestamp`) VALUES (1409590380); diff --git a/sql-files/upgrades/2014-11-03--00-45.sql b/sql-files/upgrades/2014-11-03--00-45.sql new file mode 100644 index 000000000..19d0a8ff5 --- /dev/null +++ b/sql-files/upgrades/2014-11-03--00-45.sql @@ -0,0 +1,3 @@ +#1414975503 +ALTER TABLE `char` ADD COLUMN `sex` ENUM('M','F','U') NOT NULL DEFAULT 'U'; +INSERT INTO `sql_updates` (`timestamp`) VALUES (1414975503); diff --git a/sql-files/upgrades/2015-07-08--13-08.sql b/sql-files/upgrades/2015-07-08--13-08.sql new file mode 100644 index 000000000..4d7208582 --- /dev/null +++ b/sql-files/upgrades/2015-07-08--13-08.sql @@ -0,0 +1,6 @@ +#1436360978 + +DROP TABLE IF EXISTS interreg; +DROP TABLE IF EXISTS sstatus; + +INSERT INTO `sql_updates` (`timestamp`) VALUES (1436360978); diff --git a/sql-files/upgrades/2015-08-27--20-42.sql b/sql-files/upgrades/2015-08-27--20-42.sql new file mode 100644 index 000000000..e95e1836b --- /dev/null +++ b/sql-files/upgrades/2015-08-27--20-42.sql @@ -0,0 +1,3 @@ +#1440688342 +ALTER TABLE `char` ADD COLUMN `hotkey_rowshift` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0'; +INSERT INTO `sql_updates` (`timestamp`) VALUES (1440688342); diff --git a/sql-files/upgrades/2015-12-16--12-57.sql b/sql-files/upgrades/2015-12-16--12-57.sql new file mode 100644 index 000000000..cc9ce799e --- /dev/null +++ b/sql-files/upgrades/2015-12-16--12-57.sql @@ -0,0 +1,26 @@ +#1450241859 + +-- This file is part of Hercules. +-- http://herc.ws - http://github.com/HerculesWS/Hercules +-- +-- Copyright (C) 2015-2016 Hercules Dev Team +-- +-- Hercules is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . + +ALTER TABLE `char` MODIFY COLUMN `max_hp` INT(9) NOT NULL DEFAULT '0'; +ALTER TABLE `char` MODIFY COLUMN `max_sp` INT(9) NOT NULL DEFAULT '0'; +ALTER TABLE `char` MODIFY COLUMN `hp` INT(9) NOT NULL DEFAULT '0'; +ALTER TABLE `char` MODIFY COLUMN `sp` INT(9) NOT NULL DEFAULT '0'; + +INSERT INTO `sql_updates` (`timestamp`) VALUES (1450241859); diff --git a/sql-files/upgrades/2015-12-17--15-58.sql b/sql-files/upgrades/2015-12-17--15-58.sql new file mode 100644 index 000000000..8d3dc51a3 --- /dev/null +++ b/sql-files/upgrades/2015-12-17--15-58.sql @@ -0,0 +1,22 @@ +#1450367880 + +-- This file is part of Hercules. +-- http://herc.ws - http://github.com/HerculesWS/Hercules +-- +-- Copyright (C) 2015 Hercules Dev Team +-- +-- Hercules is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . + +ALTER TABLE `char` ADD `body` smallint(5) unsigned NOT NULL default '0' AFTER `clothes_color`; +INSERT INTO `sql_updates` (`timestamp`) VALUES (1450367880); diff --git a/sql-files/upgrades/2016-03-10--22-18.sql b/sql-files/upgrades/2016-03-10--22-18.sql new file mode 100644 index 000000000..80266bcca --- /dev/null +++ b/sql-files/upgrades/2016-03-10--22-18.sql @@ -0,0 +1,22 @@ +#1457638175 + +-- This file is part of Hercules. +-- http://herc.ws - http://github.com/HerculesWS/Hercules +-- +-- Copyright (C) 2015-2016 Hercules Dev Team +-- +-- Hercules is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . + +ALTER TABLE `picklog` MODIFY `type` enum('M','P','L','T','V','S','N','C','A','R','G','E','B','O','I','X','D','U','K','Y','Z','W','Q','J','H','@','0','1','2') NOT NULL default 'P'; +INSERT INTO `sql_updates` (`timestamp`) VALUES (1457638175) diff --git a/sql-files/upgrades/2016-07-08--02-42.sql b/sql-files/upgrades/2016-07-08--02-42.sql new file mode 100644 index 000000000..94ca7e6db --- /dev/null +++ b/sql-files/upgrades/2016-07-08--02-42.sql @@ -0,0 +1,35 @@ +#1467934919 + +-- This file is part of Hercules. +-- http://herc.ws - http://github.com/HerculesWS/Hercules +-- +-- Copyright (C) 2015-2016 Hercules Dev Team +-- +-- Hercules is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . + +ALTER TABLE `charlog` MODIFY `time` DATETIME NULL; +ALTER TABLE `interlog` MODIFY `time` DATETIME NULL; +ALTER TABLE `ipbanlist` MODIFY `btime` DATETIME NULL; +ALTER TABLE `ipbanlist` MODIFY `rtime` DATETIME NULL; +ALTER TABLE `login` MODIFY `lastlogin` DATETIME NULL; +ALTER TABLE `login` MODIFY `birthdate` DATE NULL; + +UPDATE `charlog` SET `time` = NULL WHERE `time` = '0000-00-00 00:00:00'; +UPDATE `interlog` SET `time` = NULL WHERE `time` = '0000-00-00 00:00:00'; +UPDATE `ipbanlist` SET `btime` = NULL WHERE `btime` = '0000-00-00 00:00:00'; +UPDATE `ipbanlist` SET `rtime` = NULL WHERE `rtime` = '0000-00-00 00:00:00'; +UPDATE `login` SET `lastlogin` = NULL WHERE `lastlogin` = '0000-00-00 00:00:00'; +UPDATE `login` SET `birthdate` = NULL WHERE `birthdate` = '0000-00-00'; + +INSERT INTO `sql_updates` (`timestamp`) VALUES (1467934919) diff --git a/sql-files/upgrades/2016-07-08--02-51.sql b/sql-files/upgrades/2016-07-08--02-51.sql new file mode 100644 index 000000000..8ecf1a25f --- /dev/null +++ b/sql-files/upgrades/2016-07-08--02-51.sql @@ -0,0 +1,30 @@ +#1467935469 + +-- This file is part of Hercules. +-- http://herc.ws - http://github.com/HerculesWS/Hercules +-- +-- Copyright (C) 2015-2016 Hercules Dev Team +-- +-- Hercules is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . + +ALTER TABLE `atcommandlog` MODIFY `atcommand_date` DATETIME NULL; +ALTER TABLE `branchlog` MODIFY `branch_date` DATETIME NULL; +ALTER TABLE `chatlog` MODIFY `time` DATETIME NULL; +ALTER TABLE `loginlog` MODIFY `time` DATETIME NULL; +ALTER TABLE `mvplog` MODIFY `mvp_date` DATETIME NULL; +ALTER TABLE `npclog` MODIFY `npc_date` DATETIME NULL; +ALTER TABLE `picklog` MODIFY `time` DATETIME NULL; +ALTER TABLE `zenylog` MODIFY `time` DATETIME NULL; + +INSERT INTO `sql_updates` (`timestamp`) VALUES (1467935469) diff --git a/sql-files/upgrades/2016-10-03--20-27.sql b/sql-files/upgrades/2016-10-03--20-27.sql new file mode 100644 index 000000000..6ad840e05 --- /dev/null +++ b/sql-files/upgrades/2016-10-03--20-27.sql @@ -0,0 +1,23 @@ +#1475526420 + +-- This file is part of Hercules. +-- http://herc.ws - http://github.com/HerculesWS/Hercules +-- +-- Copyright (C) 2015-2016 Hercules Dev Team +-- +-- Hercules is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . + +ALTER TABLE `charlog` ADD `class` MEDIUMINT(9) NOT NULL DEFAULT '0' AFTER `char_num`; + +INSERT INTO `sql_updates` (`timestamp`) VALUES (1475526420); diff --git a/sql-files/upgrades/2016-10-26--10-29.sql b/sql-files/upgrades/2016-10-26--10-29.sql new file mode 100644 index 000000000..cabd7db10 --- /dev/null +++ b/sql-files/upgrades/2016-10-26--10-29.sql @@ -0,0 +1,23 @@ +#1477434595 + +-- This file is part of Hercules. +-- http://herc.ws - http://github.com/HerculesWS/Hercules +-- +-- Copyright (C) 2015-2016 Hercules Dev Team +-- +-- Hercules is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . + +ALTER TABLE `zenylog` CHANGE `type` `type` ENUM('T','V','P','M','S','N','D','C','A','E','I','B','K') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'S'; + +INSERT INTO `sql_updates` (`timestamp`, `ignored`) VALUES (1477434595 , 'No'); diff --git a/sql-files/upgrades/2017-03-02--11-40.sql b/sql-files/upgrades/2017-03-02--11-40.sql new file mode 100644 index 000000000..30798b5df --- /dev/null +++ b/sql-files/upgrades/2017-03-02--11-40.sql @@ -0,0 +1,93 @@ +#1488454834 + +-- This file is part of Hercules. +-- http://herc.ws - http://github.com/HerculesWS/Hercules +-- +-- Copyright (C) 2015-2016 Hercules Dev Team +-- +-- Hercules is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . + +ALTER TABLE `auction` + ADD COLUMN `opt_idx0` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `card3`, + ADD COLUMN `opt_val0` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx0`, + ADD COLUMN `opt_idx1` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val0`, + ADD COLUMN `opt_val1` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx1`, + ADD COLUMN `opt_idx2` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val1`, + ADD COLUMN `opt_val2` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx2`, + ADD COLUMN `opt_idx3` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val2`, + ADD COLUMN `opt_val3` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx3`, + ADD COLUMN `opt_idx4` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val3`, + ADD COLUMN `opt_val4` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx4`; + +ALTER TABLE `cart_inventory` + ADD COLUMN `opt_idx0` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `card3`, + ADD COLUMN `opt_val0` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx0`, + ADD COLUMN `opt_idx1` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val0`, + ADD COLUMN `opt_val1` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx1`, + ADD COLUMN `opt_idx2` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val1`, + ADD COLUMN `opt_val2` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx2`, + ADD COLUMN `opt_idx3` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val2`, + ADD COLUMN `opt_val3` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx3`, + ADD COLUMN `opt_idx4` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val3`, + ADD COLUMN `opt_val4` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx4`; + +ALTER TABLE `guild_storage` + ADD COLUMN `opt_idx0` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `card3`, + ADD COLUMN `opt_val0` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx0`, + ADD COLUMN `opt_idx1` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val0`, + ADD COLUMN `opt_val1` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx1`, + ADD COLUMN `opt_idx2` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val1`, + ADD COLUMN `opt_val2` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx2`, + ADD COLUMN `opt_idx3` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val2`, + ADD COLUMN `opt_val3` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx3`, + ADD COLUMN `opt_idx4` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val3`, + ADD COLUMN `opt_val4` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx4`; + +ALTER TABLE `inventory` + ADD COLUMN `opt_idx0` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `card3`, + ADD COLUMN `opt_val0` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx0`, + ADD COLUMN `opt_idx1` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val0`, + ADD COLUMN `opt_val1` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx1`, + ADD COLUMN `opt_idx2` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val1`, + ADD COLUMN `opt_val2` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx2`, + ADD COLUMN `opt_idx3` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val2`, + ADD COLUMN `opt_val3` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx3`, + ADD COLUMN `opt_idx4` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val3`, + ADD COLUMN `opt_val4` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx4`; + +ALTER TABLE `mail` + ADD COLUMN `opt_idx0` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `card3`, + ADD COLUMN `opt_val0` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx0`, + ADD COLUMN `opt_idx1` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val0`, + ADD COLUMN `opt_val1` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx1`, + ADD COLUMN `opt_idx2` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val1`, + ADD COLUMN `opt_val2` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx2`, + ADD COLUMN `opt_idx3` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val2`, + ADD COLUMN `opt_val3` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx3`, + ADD COLUMN `opt_idx4` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val3`, + ADD COLUMN `opt_val4` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx4`; + +ALTER TABLE `storage` + ADD COLUMN `opt_idx0` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `card3`, + ADD COLUMN `opt_val0` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx0`, + ADD COLUMN `opt_idx1` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val0`, + ADD COLUMN `opt_val1` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx1`, + ADD COLUMN `opt_idx2` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val1`, + ADD COLUMN `opt_val2` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx2`, + ADD COLUMN `opt_idx3` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val2`, + ADD COLUMN `opt_val3` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx3`, + ADD COLUMN `opt_idx4` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val3`, + ADD COLUMN `opt_val4` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx4`; + +INSERT INTO `sql_updates` (`timestamp`, `ignored`) VALUES (1488454834 , 'No'); diff --git a/sql-files/upgrades/2017-03-05--08-09.sql b/sql-files/upgrades/2017-03-05--08-09.sql new file mode 100644 index 000000000..3b5ee1a23 --- /dev/null +++ b/sql-files/upgrades/2017-03-05--08-09.sql @@ -0,0 +1,15 @@ +#1488744559 + +ALTER TABLE `picklog` + ADD COLUMN `opt_idx0` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `card3`, + ADD COLUMN `opt_val0` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx0`, + ADD COLUMN `opt_idx1` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val0`, + ADD COLUMN `opt_val1` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx1`, + ADD COLUMN `opt_idx2` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val1`, + ADD COLUMN `opt_val2` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx2`, + ADD COLUMN `opt_idx3` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val2`, + ADD COLUMN `opt_val3` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx3`, + ADD COLUMN `opt_idx4` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val3`, + ADD COLUMN `opt_val4` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx4`; + +INSERT INTO `sql_updates` (`timestamp`, `ignored`) VALUES (1488744559 , 'No'); diff --git a/sql-files/upgrades/2017-03-15--14-29.sql b/sql-files/upgrades/2017-03-15--14-29.sql new file mode 100644 index 000000000..6e6044738 --- /dev/null +++ b/sql-files/upgrades/2017-03-15--14-29.sql @@ -0,0 +1,74 @@ +#1489588190 + +-- This file is part of Hercules. +-- http://herc.ws - http://github.com/HerculesWS/Hercules +-- +-- Copyright (C) 2017 Hercules Dev Team +-- +-- Hercules is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . + +CREATE TABLE IF NOT EXISTS `rodex_items` ( + `id` INT(11) NOT NULL AUTO_INCREMENT, + `mail_id` BIGINT(20) NOT NULL DEFAULT '0', + `nameid` INT(11) NOT NULL DEFAULT '0', + `amount` INT(11) NOT NULL DEFAULT '0', + `equip` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `identify` SMALLINT(6) NOT NULL DEFAULT '0', + `refine` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0', + `attribute` TINYINT(4) NOT NULL DEFAULT '0', + `card0` SMALLINT(11) NOT NULL DEFAULT '0', + `card1` SMALLINT(11) NOT NULL DEFAULT '0', + `card2` SMALLINT(11) NOT NULL DEFAULT '0', + `card3` SMALLINT(11) NOT NULL DEFAULT '0', + `opt_idx0` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0', + `opt_val0` SMALLINT(5) NOT NULL DEFAULT '0', + `opt_idx1` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0', + `opt_val1` SMALLINT(5) NOT NULL DEFAULT '0', + `opt_idx2` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0', + `opt_val2` SMALLINT(5) NOT NULL DEFAULT '0', + `opt_idx3` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0', + `opt_val3` SMALLINT(5) NOT NULL DEFAULT '0', + `opt_idx4` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0', + `opt_val4` SMALLINT(5) NOT NULL DEFAULT '0', + `expire_time` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `bound` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + `unique_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `mail_id` (`mail_id`) +) ENGINE=InnoDB; + +CREATE TABLE IF NOT EXISTS `rodex_mail` ( + `mail_id` BIGINT(20) NOT NULL AUTO_INCREMENT, + `sender_name` VARCHAR(30) NOT NULL COLLATE 'utf8_unicode_ci', + `sender_id` INT(11) NOT NULL, + `receiver_name` VARCHAR(30) NOT NULL COLLATE 'utf8_unicode_ci', + `receiver_id` INT(11) NOT NULL, + `receiver_accountid` INT(11) NOT NULL, + `title` VARCHAR(50) NOT NULL COLLATE 'utf8_unicode_ci', + `body` VARCHAR(510) NOT NULL COLLATE 'utf8_unicode_ci', + `zeny` BIGINT(20) NOT NULL, + `type` TINYINT(8) UNSIGNED NOT NULL, + `is_read` TINYINT(8) NOT NULL, + `send_date` INT(11) NOT NULL, + `expire_date` INT(11) NOT NULL, + `weight` INT(11) NOT NULL, + PRIMARY KEY (`mail_id`), + KEY `sender_id` (`sender_id`), + KEY `receiver_id` (`receiver_id`), + KEY `receiver_accountid` (`receiver_accountid`), + KEY `send_date` (`send_date`), + KEY `expire_date` (`expire_date`) +) ENGINE=MyISAM; + +INSERT INTO `sql_updates` (`timestamp`, `ignored`) VALUES (1489588190 , 'No'); diff --git a/sql-files/upgrades/2017-11-04--10-39.sql b/sql-files/upgrades/2017-11-04--10-39.sql new file mode 100644 index 000000000..f95dbef0c --- /dev/null +++ b/sql-files/upgrades/2017-11-04--10-39.sql @@ -0,0 +1,6 @@ +#1509835214 + +ALTER TABLE `homunculus` + ADD COLUMN `autofeed` TINYINT(2) NOT NULL DEFAULT '0' AFTER `vaporize`; + +INSERT INTO `sql_updates` (`timestamp`, `ignored`) VALUES (1509835214 , 'No'); diff --git a/sql-files/upgrades/index.txt b/sql-files/upgrades/index.txt new file mode 100644 index 000000000..5e5add203 --- /dev/null +++ b/sql-files/upgrades/index.txt @@ -0,0 +1,42 @@ +2013-02-14--16-15.sql +2013-02-15--18-06.sql +2013-03-05--01-05.sql +2013-03-06--00-00.sql +2013-03-09--01-56.sql +2013-03-27--18-35.sql +2013-04-16--01-24.sql +2013-04-16--02-15.sql +2013-10-09--21-38.sql +2013-10-10--16-36.sql +2013-10-27--16-47.sql +2013-10-30--19-53.sql +2013-10-30--21-12.sql +2013-10-31--07-49.sql +2013-11-09--00-03.sql +2013-11-15--00-06.sql +2013-11-15--19-57.sql +2013-11-16--07-49.sql +2013-11-18--08-23.sql +2013-12-24--00-15.sql +2014-01-04--16-47.sql +2014-01-06--17-22.sql +2014-02-19--17-57.sql +2014-03-25--23-57.sql +2014-04-07--22-04.sql +2014-04-26--10-00.sql +2014-05-17--00-06.sql +2014-09-01--16-53.sql +2014-11-03--00-45.sql +2015-07-08--13-08.sql +2015-08-27--20-42.sql +2015-12-16--12-57.sql +2015-12-17--15-58.sql +2016-03-10--22-18.sql +2016-07-08--02-42.sql +2016-07-08--02-51.sql +2016-10-03--20-27.sql +2016-10-26--10-29.sql +2017-03-02--11-40.sql +2017-03-05--08-09.sql +2017-03-15--14-29.sql +2017-11-04--10-39.sql -- cgit v1.2.3-70-g09d2