diff options
Diffstat (limited to 'sql-files/upgrades')
-rw-r--r-- | sql-files/upgrades/2013-10-09--21-38.sql | 3 | ||||
-rw-r--r-- | sql-files/upgrades/2013-10-10--16-36.sql | 7 | ||||
-rw-r--r-- | sql-files/upgrades/2013-10-27--16-47.sql | 6 | ||||
-rw-r--r-- | sql-files/upgrades/2013-10-30--19-53.sql | 5 | ||||
-rw-r--r-- | sql-files/upgrades/2013-10-30--21-12.sql | 3 | ||||
-rw-r--r-- | sql-files/upgrades/2013-10-31--07-49.sql | 6 | ||||
-rw-r--r-- | sql-files/upgrades/2013-11-09--00-03.sql | 5 | ||||
-rw-r--r-- | sql-files/upgrades/2013-11-15--00-06.sql | 105 | ||||
-rw-r--r-- | sql-files/upgrades/2013-11-15--19-57.sql | 5 | ||||
-rw-r--r-- | sql-files/upgrades/2013-11-16--07-49.sql | 3 | ||||
-rw-r--r-- | sql-files/upgrades/2013-11-18--08-23.sql | 65 | ||||
-rw-r--r-- | sql-files/upgrades/2013-12-24--00-15.sql | 8 | ||||
-rw-r--r-- | sql-files/upgrades/2014-01-04--16-47.sql | 61 | ||||
-rw-r--r-- | sql-files/upgrades/2014-01-06--17-22.sql | 16 | ||||
-rw-r--r-- | sql-files/upgrades/2014-02-19--17-57.sql | 4 | ||||
-rw-r--r-- | sql-files/upgrades/index.txt | 15 | ||||
-rw-r--r-- | sql-files/upgrades/rAthena-main-upgrade.sql | 87 | ||||
-rw-r--r-- | sql-files/upgrades/rathena-logs-database-upgrade | 13 |
18 files changed, 417 insertions, 0 deletions
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..fee85c40b --- /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);
\ No newline at end of file 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..784449898 --- /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);
\ No newline at end of file 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..e1a4a28f2 --- /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);
\ No newline at end of file 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..8bc63b1f1 --- /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);
\ No newline at end of file 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..fdc16f418 --- /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);
\ No newline at end of file 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..f0c51b0d9 --- /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);
\ No newline at end of file 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..09c63307f --- /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);
\ No newline at end of file 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..09749bfc3 --- /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..0644c47c9 --- /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);
\ No newline at end of file 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..9f4b80452 --- /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);
\ No newline at end of file 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..d5da5fd95 --- /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..b1f8d019d --- /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..a60ec1d24 --- /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);
\ No newline at end of file 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..0ba9cb69f --- /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..ebebe6665 --- /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);
\ No newline at end of file diff --git a/sql-files/upgrades/index.txt b/sql-files/upgrades/index.txt index 984898b22..39fbd0070 100644 --- a/sql-files/upgrades/index.txt +++ b/sql-files/upgrades/index.txt @@ -4,3 +4,18 @@ 2013-03-06--00-00.sql 2013-03-09--01-56.sql 2013-04-16--01-24.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
\ No newline at end of file diff --git a/sql-files/upgrades/rAthena-main-upgrade.sql b/sql-files/upgrades/rAthena-main-upgrade.sql new file mode 100644 index 000000000..19f6d55ec --- /dev/null +++ b/sql-files/upgrades/rAthena-main-upgrade.sql @@ -0,0 +1,87 @@ +-- rAthena to Hercules main database upgrade query. +-- This upgrades a FULLY UPGRADED rAthena to a FULLY UPGRADED Hercules +-- Please don't use if either rAthena or Hercules launched a SQL update after last revision date of this file. +-- Remember to make a backup before applying. +-- We are not liable for any data loss this may cause. +-- Apply in the same database you applied your main.sql + +-- Drop table contents from ´sc_data´ since we use a different status order than rAthena +-- /!\ WARNING /!\ This will remove _ALL_ of the status effects active on the server +-- This will remove even jailed status from users! +TRUNCATE TABLE `sc_data`; + + +-- Drop table `skillcooldown` since it's not used in Hercules +DROP TABLE IF EXISTS `skillcooldown`; + +-- Upgrades for table `cart_inventory` +ALTER TABLE `cart_inventory` MODIFY `bound` tinyint(1) unsigned NOT NULL default '0'; + +-- Upgrades for table `char` +ALTER TABLE `char` CHANGE `moves` `slotchange` SMALLINT(3) UNSIGNED NOT NULL default '0', + ADD `char_opt` INT( 11 ) UNSIGNED NOT NULL default '0', + ADD `font` TINYINT( 3 ) UNSIGNED NOT NULL DEFAULT '0'; + ADD `unban_time` int(11) unsigned NOT NULL default '0'; + +-- Upgrades for table `guild_storage` +ALTER TABLE `guild_storage` MODIFY `bound` tinyint(1) unsigned NOT NULL default '0'; + +-- Upgrades for table `inventory` +ALTER TABLE `inventory` MODIFY `bound` tinyint(1) unsigned NOT NULL default '0'; + +-- Bank vault is saved later since we need to make a table rAthena doesn't have first + +-- +-- Table structure for table `sql_updates` +-- +CREATE TABLE IF NOT EXISTS `sql_updates` ( + `timestamp` int(11) unsigned NOT NULL, + `ignored` enum('Yes','No') NOT NULL DEFAULT 'No', + PRIMARY KEY (`timestamp`) +) ENGINE=MyISAM; + +-- Existent updates to enter +INSERT INTO `sql_updates` (`timestamp`) VALUES (1360858500); +INSERT INTO `sql_updates` (`timestamp`) VALUES (1360951560); +INSERT INTO `sql_updates` (`timestamp`) VALUES (1362445531); +INSERT INTO `sql_updates` (`timestamp`) VALUES (1362528000); +INSERT INTO `sql_updates` (`timestamp`) VALUES (1362794218); +INSERT INTO `sql_updates` (`timestamp`) VALUES (1364409316); +INSERT INTO `sql_updates` (`timestamp`) VALUES (1366075474); +INSERT INTO `sql_updates` (`timestamp`) VALUES (1366078541); +INSERT INTO `sql_updates` (`timestamp`) VALUES (1381354728); +INSERT INTO `sql_updates` (`timestamp`) VALUES (1381423003); +INSERT INTO `sql_updates` (`timestamp`) VALUES (1382892428); +INSERT INTO `sql_updates` (`timestamp`) VALUES (1383162785); +INSERT INTO `sql_updates` (`timestamp`) VALUES (1383167577); +INSERT INTO `sql_updates` (`timestamp`) VALUES (1383205740); +INSERT INTO `sql_updates` (`timestamp`) VALUES (1383955424); +INSERT INTO `sql_updates` (`timestamp`) VALUES (1384545461); +INSERT INTO `sql_updates` (`timestamp`) VALUES (1384588175); + +-- Updates to table `storage` +ALTER TABLE `storage` MODIFY `bound` tinyint(1) unsigned NOT NULL default '0'; + +-- +-- Table structure for table `account_data` +-- + +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', + `base_exp` TINYINT( 4 ) UNSIGNED NOT NULL default '100', + `base_drop` TINYINT( 4 ) UNSIGNED NOT NULL default '100', + `base_death` TINYINT( 4 ) UNSIGNED NOT NULL default '100', + PRIMARY KEY (`account_id`) +) ENGINE=MyISAM; + +-- Saving bank_vault data from rAthena's login table +-- to our account_data table. There may be some not working cases. + +INSERT INTO `account_data` (`account_id`, `bank_vault`) SELECT `account_id`, `bank_vault` FROM `login` WHERE `bank_vault` > 0 ; + +-- Dropping bank_vault column from login table +ALTER TABLE `login` DROP COLUMN `bank_vault`; + +-- Drop table `bonus_script` since it's not used in Hercules +DROP TABLE IF EXISTS `bonus_script`; diff --git a/sql-files/upgrades/rathena-logs-database-upgrade b/sql-files/upgrades/rathena-logs-database-upgrade new file mode 100644 index 000000000..7cdf58992 --- /dev/null +++ b/sql-files/upgrades/rathena-logs-database-upgrade @@ -0,0 +1,13 @@ +-- rAthena to Hercules log database upgrade query. +-- This upgrades a FULLY UPGRADED rAthena to a FULLY UPGRADED Hercules +-- Please don't use if either rAthena or Hercules launched a SQL update after last revision date of this file. +-- Remember to make a backup before applying. +-- We are not liable for any data loss this may cause. +-- Apply in the same database you applied your logs.sql +-- Last revision: November 10, 2013, 19:00 + +-- Upgrades to table `picklog` +ALTER TABLE `picklog` MODIFY `type` enum('M','P','L','T','V','S','N','C','A','R','G','E','B','O','I','X','D','U') NOT NULL default 'P'; + +-- Drop table `cashlog` since it's not used in Hercules +DROP TABLE IF EXISTS `cashlog`; |