From 54c250068e565793c53f5a558204c9d177456060 Mon Sep 17 00:00:00 2001 From: jaBote Date: Sun, 10 Nov 2013 20:53:00 +0100 Subject: Added rAthena to Hercules main database upgrader. This has been added because a lot of people were suggesting this on the forums. Check the news topic for more info: http://hercules.ws/board/topic/2906-introducing-rathena-to-hercules-database-converters/?p=19260 --- sql-files/upgrades/rAthena-main-upgrade.sql | 80 +++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 sql-files/upgrades/rAthena-main-upgrade.sql (limited to 'sql-files/upgrades/rAthena-main-upgrade.sql') diff --git a/sql-files/upgrades/rAthena-main-upgrade.sql b/sql-files/upgrades/rAthena-main-upgrade.sql new file mode 100644 index 000000000..5da6c9446 --- /dev/null +++ b/sql-files/upgrades/rAthena-main-upgrade.sql @@ -0,0 +1,80 @@ +-- 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 +-- Last revision: November 10, 2013, 19:00 + + +-- 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 `equip` INT(11) UNSIGNED NOT NULL default '0', + MODIFY `bound` tinyint(1) unsigned NOT NULL default '0'; + +-- Upgrades for table `char` +ALTER TABLE `char` DROP COLUMN `moves`, + ADD `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'; + +-- Upgrades for table `guild_storage` +ALTER TABLE `guild_storage` MODIFY `equip` INT(11) UNSIGNED NOT NULL default '0', + MODIFY `bound` tinyint(1) unsigned NOT NULL default '0'; + +-- Upgrades for table `inventory` +ALTER TABLE `inventory` MODIFY `equip` INT(11) UNSIGNED NOT NULL default '0', + MODIFY `bound` tinyint(1) unsigned NOT NULL default '0'; + +-- +-- 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); + +-- Updates to table `storage` +ALTER TABLE `storage` MODIFY `equip` INT(11) UNSIGNED NOT NULL default '0', + 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`; -- cgit v1.2.3-70-g09d2 From 8f2838878c954adc839e00d92e4663c764fb3c01 Mon Sep 17 00:00:00 2001 From: jaBote Date: Sun, 10 Nov 2013 22:51:05 +0100 Subject: Update rAthena-main-upgrade.sql Now it deletes all entries on the sc_data table since it's dangerous if we port the sc data as is. WARNING, this ends all active SCs on the previous server! Even jailed state! --- sql-files/upgrades/rAthena-main-upgrade.sql | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sql-files/upgrades/rAthena-main-upgrade.sql') diff --git a/sql-files/upgrades/rAthena-main-upgrade.sql b/sql-files/upgrades/rAthena-main-upgrade.sql index 5da6c9446..6d543918f 100644 --- a/sql-files/upgrades/rAthena-main-upgrade.sql +++ b/sql-files/upgrades/rAthena-main-upgrade.sql @@ -6,6 +6,11 @@ -- Apply in the same database you applied your main.sql -- Last revision: November 10, 2013, 19:00 +-- 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`; -- cgit v1.2.3-70-g09d2 From 044332d0420e1c8d477f07be7b31358bb133fd17 Mon Sep 17 00:00:00 2001 From: jaBote Date: Fri, 15 Nov 2013 20:37:53 +0100 Subject: Update rAthena-main-upgrade.sql Made the converter keep some more data (rAthena's `moves` column is equivalent to our `slotchange` in the `login` table) and made it a tidbit more efficient since with their last updates their DB is now more similar to ours :D --- sql-files/upgrades/rAthena-main-upgrade.sql | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'sql-files/upgrades/rAthena-main-upgrade.sql') diff --git a/sql-files/upgrades/rAthena-main-upgrade.sql b/sql-files/upgrades/rAthena-main-upgrade.sql index 6d543918f..ac9f90342 100644 --- a/sql-files/upgrades/rAthena-main-upgrade.sql +++ b/sql-files/upgrades/rAthena-main-upgrade.sql @@ -16,22 +16,20 @@ TRUNCATE TABLE `sc_data`; DROP TABLE IF EXISTS `skillcooldown`; -- Upgrades for table `cart_inventory` -ALTER TABLE `cart_inventory` MODIFY `equip` INT(11) UNSIGNED NOT NULL default '0', - MODIFY `bound` tinyint(1) unsigned NOT NULL default '0'; +ALTER TABLE `cart_inventory` MODIFY `bound` tinyint(1) unsigned NOT NULL default '0'; -- Upgrades for table `char` -ALTER TABLE `char` DROP COLUMN `moves`, - ADD `slotchange` SMALLINT(3) UNSIGNED NOT NULL default '0', +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'; -- Upgrades for table `guild_storage` -ALTER TABLE `guild_storage` MODIFY `equip` INT(11) UNSIGNED NOT NULL default '0', - MODIFY `bound` tinyint(1) unsigned NOT NULL default '0'; +ALTER TABLE `guild_storage` MODIFY `bound` tinyint(1) unsigned NOT NULL default '0'; -- Upgrades for table `inventory` -ALTER TABLE `inventory` MODIFY `equip` INT(11) UNSIGNED NOT NULL default '0', - MODIFY `bound` tinyint(1) unsigned NOT NULL default '0'; +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` @@ -60,8 +58,7 @@ INSERT INTO `sql_updates` (`timestamp`) VALUES (1383205740); INSERT INTO `sql_updates` (`timestamp`) VALUES (1383955424); -- Updates to table `storage` -ALTER TABLE `storage` MODIFY `equip` INT(11) UNSIGNED NOT NULL default '0', - MODIFY `bound` tinyint(1) unsigned NOT NULL default '0'; +ALTER TABLE `storage` MODIFY `bound` tinyint(1) unsigned NOT NULL default '0'; -- -- Table structure for table `account_data` @@ -83,3 +80,6 @@ INSERT INTO `account_data` (`account_id`, `bank_vault`) SELECT `account_id`, `ba -- 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`; -- cgit v1.2.3-70-g09d2 From f0591e607e05e34d987a7575fbaf9af53daa5908 Mon Sep 17 00:00:00 2001 From: jaBote Date: Fri, 15 Nov 2013 22:42:05 +0100 Subject: Update rAthena-main-upgrade.sql. Follow-up 40262e063a7d503104667a4135c564d996bc49c6 Just added the new SQL update on the converter =) --- sql-files/upgrades/rAthena-main-upgrade.sql | 1 + 1 file changed, 1 insertion(+) (limited to 'sql-files/upgrades/rAthena-main-upgrade.sql') diff --git a/sql-files/upgrades/rAthena-main-upgrade.sql b/sql-files/upgrades/rAthena-main-upgrade.sql index ac9f90342..d91ca09fe 100644 --- a/sql-files/upgrades/rAthena-main-upgrade.sql +++ b/sql-files/upgrades/rAthena-main-upgrade.sql @@ -56,6 +56,7 @@ 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); -- Updates to table `storage` ALTER TABLE `storage` MODIFY `bound` tinyint(1) unsigned NOT NULL default '0'; -- cgit v1.2.3-70-g09d2 From be6440dfb609b4ce28ca973a8987ab434774c8ed Mon Sep 17 00:00:00 2001 From: jaBote Date: Sat, 16 Nov 2013 21:19:56 +0100 Subject: Update rAthena-main-upgrade.sql Follow-up aee2f6317e1c927847993801b5973d7e2e27a418 --- sql-files/upgrades/rAthena-main-upgrade.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sql-files/upgrades/rAthena-main-upgrade.sql') diff --git a/sql-files/upgrades/rAthena-main-upgrade.sql b/sql-files/upgrades/rAthena-main-upgrade.sql index d91ca09fe..19f6d55ec 100644 --- a/sql-files/upgrades/rAthena-main-upgrade.sql +++ b/sql-files/upgrades/rAthena-main-upgrade.sql @@ -4,7 +4,6 @@ -- 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 --- Last revision: November 10, 2013, 19:00 -- 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 @@ -22,6 +21,7 @@ ALTER TABLE `cart_inventory` MODIFY `bound` tinyint(1) unsigned NOT NULL default 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'; @@ -57,6 +57,7 @@ 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'; -- cgit v1.2.3-70-g09d2 From 26f2adab3126c5b76a93c3220ccfb4aec7db07e1 Mon Sep 17 00:00:00 2001 From: jaBote Date: Fri, 21 Mar 2014 21:39:26 +0100 Subject: Update rAthena-main-upgrade.sql Added in the differences from some months ago. Very special thanks to @dastgirpojee for the autotrade saving script! None of us could test with actual data, so feel free to try it and point out any flaws you can see. --- sql-files/upgrades/rAthena-main-upgrade.sql | 258 +++++++++++++++++++++++++--- 1 file changed, 231 insertions(+), 27 deletions(-) (limited to 'sql-files/upgrades/rAthena-main-upgrade.sql') diff --git a/sql-files/upgrades/rAthena-main-upgrade.sql b/sql-files/upgrades/rAthena-main-upgrade.sql index 19f6d55ec..165584795 100644 --- a/sql-files/upgrades/rAthena-main-upgrade.sql +++ b/sql-files/upgrades/rAthena-main-upgrade.sql @@ -4,36 +4,55 @@ -- 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 +-- Last revised: March 21, 2014 20:30 -- 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 +-- You can disable this, but this is a SECURITY MEASURE -- 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'; + ADD `char_opt` INT( 11 ) UNSIGNED NOT NULL default '0' AFTER `slotchange`, + ADD `font` TINYINT( 3 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `char_opt`; + -- 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 + +-- Login table will be upgraded at a later point on this file +-- so that we can save the bank vault. + + +-- Upgrades for table `mapreg` +ALTER TABLE `mapreg` MODIFY `varname` varchar(32) BINARY NOT NULL, + DROP KEY `varname`, + DROP KEY `index`, + ADD PRIMARY KEY (`varname`,`index`); + + +-- Upgrades for table `sc_data` +ALTER TABLE `sc_data` ADD PRIMARY KEY (`account_id`,`char_id`,`type`); + -- -- 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', @@ -41,27 +60,35 @@ CREATE TABLE IF NOT EXISTS `sql_updates` ( ) 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); +INSERT INTO `sql_updates` (`timestamp`) VALUES (1360858500); -- 2013-02-14--16-15.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1360951560); -- 2013-02-15--18-06.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1362445531); -- 2013-03-05--01-05.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1362528000); -- 2013-03-06--00-00.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1362794218); -- 2013-03-09--01-56.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1364409316); -- 2013-03-27--18-35.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1366075474); -- 2013-04-16--01-24.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1366078541); -- 2013-04-16--02-15.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1381354728); -- 2013-10-09--21-38.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1381423003); -- 2013-10-10--16-36.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1382892428); -- 2013-10-27--16-47.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1383162785); -- 2013-10-30--19-53.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1383167577); -- 2013-10-30--21-12.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1383205740); -- 2013-10-31--07-49.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1383955424); -- 2013-11-09--00-03.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1384473995); -- 2013-11-15--00-06.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1384545461); -- 2013-11-15--19-57.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1384588175); -- 2013-11-16--07-49.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1384763034); -- 2013-11-18--08-23.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1387844126); -- 2013-12-24--00-15.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1388854043); -- 2014-01-04--16-47.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1389028967); -- 2014-01-06--17-22.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1392832626); -- 2014-02-19--17-57.sql + -- Updates to table `storage` ALTER TABLE `storage` MODIFY `bound` tinyint(1) unsigned NOT NULL default '0'; + -- -- Table structure for table `account_data` -- @@ -72,16 +99,193 @@ CREATE TABLE IF NOT EXISTS `account_data` ( `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; + 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`; + +-- Upgrades for table `login` +ALTER TABLE `login` DROP COLUMN `vip_time`, + DROP COLUMN `old_group`, + DROP COLUMN `bank_vault`; + -- Drop table `bonus_script` since it's not used in Hercules DROP TABLE IF EXISTS `bonus_script`; + + +-- +-- Table structure for table `npc_market_data` +-- + +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; + + +-- Autotrade saving. Very special thanks to Dastgir Pojee! +-- +-- Vending Database Update +-- + +-- Vending_Items Update +ALTER TABLE `vending_items` + ADD `char_id` INT(11) NOT NULL DEFAULT '0' AFTER `index`; + +UPDATE `vending_items` v1, `vendings` v2 + SET v1.char_id = v2.char_id + WHERE v1.vending_id = v2.id; + +ALTER TABLE `vending_items` + DROP `vending_id`, + DROP `index`, + CHANGE `cartinventory_id` `itemkey` INT(11) NOT NULL DEFAULT '0', + MODIFY `amount` INT(11) NOT NULL DEFAULT '0', + MODIFY `price` INT(11) NOT NULL DEFAULT '0'; + +ALTER TABLE `vending_items` + ADD PRIMARY KEY( `char_id`, `itemkey`); + +RENAME TABLE `vending_items` TO `autotrade_data`; + +-- Vending Data Update +ALTER TABLE `vendings` + DROP `id`, + DROP `map`, + DROP `x`, + DROP `y`, + DROP `autotrade`; + +ALTER TABLE `vendings` + CHANGE `sex` `sex_ref` ENUM('F','M') CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT 'M'; + +ALTER TABLE `vendings` + MODIFY `account_id` INT(11) NOT NULL DEFAULT '0', + MODIFY `char_id` INT(11) NOT NULL DEFAULT '0', + ADD `sex` TINYINT(2) NOT NULL DEFAULT '0' AFTER `char_id`, + MODIFY `title` VARCHAR(80) NOT NULL DEFAULT 'Buy From Me!'; + +UPDATE `vendings` + SET `sex` = 0 + WHERE `sex_ref` = 'F'; + +UPDATE `vendings` + SET `sex` = 1 + WHERE `sex_ref` = 'M'; + +ALTER TABLE `vendings` DROP `sex_ref`; + +ALTER TABLE `vendings` ADD PRIMARY KEY( `account_id`, `char_id`); + +RENAME TABLE `vendings` TO `autotrade_merchants`; + +-- Autotrade saving ended + + +-- We don't support saving buyingstores yet... +-- Comment next statement if you want to preserve them anyways +DROP TABLE IF EXISTS `buyingstores`, `buyingstore_items`; + + +-- Saving contents of `global_reg_value` + +-- +-- Table structure for table `acc_reg_num_db` +-- + +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; + + +-- +-- Table structure for table `acc_reg_str_db` +-- + +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; + + +-- +-- Table structure for table `char_reg_num_db` +-- + +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; + + +-- +-- Table structure for table `char_reg_str_db` +-- + +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; + + +-- +-- Table structure for table `global_acc_reg_num_db` +-- + +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; + + +-- +-- Table structure for table `global_acc_reg_str_db` +-- + +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; + + +-- Saving the data +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 '%$'; + +-- Dropping now useless table +DROP TABLE `global_reg_value`; -- cgit v1.2.3-70-g09d2 From aa120720cec6ba1ddf6ec8ac6098fef6377dddc0 Mon Sep 17 00:00:00 2001 From: panikon Date: Sat, 22 Mar 2014 00:07:10 -0300 Subject: Fixed issue 7338 (added new char configuration char_aegis_delete) http://hercules.ws/board/tracker/issue-7338-deleting-character/ As @jaBote requested in 26f2ada, renamed "rathena-logs-database-upgrade" to "rAthena-logs-upgrade.sql" and updated 'last revision'. Added a 'FIXME' in db_obj_put --- conf/char-server.conf | 5 +++ sql-files/upgrades/rAthena-logs-upgrade.sql | 13 +++++++ sql-files/upgrades/rAthena-main-upgrade.sql | 2 +- sql-files/upgrades/rathena-logs-database-upgrade | 13 ------- src/char/char.c | 47 ++++++++++++++++-------- src/common/db.c | 2 + 6 files changed, 53 insertions(+), 29 deletions(-) create mode 100644 sql-files/upgrades/rAthena-logs-upgrade.sql delete mode 100644 sql-files/upgrades/rathena-logs-database-upgrade (limited to 'sql-files/upgrades/rAthena-main-upgrade.sql') diff --git a/conf/char-server.conf b/conf/char-server.conf index b1172e654..7ebb7ed00 100644 --- a/conf/char-server.conf +++ b/conf/char-server.conf @@ -150,6 +150,11 @@ char_del_level: 0 // NOTE: Requires client 2010-08-03aragexeRE or newer. char_del_delay: 86400 +// Block deletion if character is inside a guild or a party? (BOOL) +// default: 0 official: 1 +// !!This check is imposed by Aegis to avoid dead entries in databases and _is_not_needed_ as we clear data properly!! +char_aegis_delete: 0 + // What folder the DB files are in (item_db.txt, etc.) db_path: db diff --git a/sql-files/upgrades/rAthena-logs-upgrade.sql b/sql-files/upgrades/rAthena-logs-upgrade.sql new file mode 100644 index 000000000..b523f8444 --- /dev/null +++ b/sql-files/upgrades/rAthena-logs-upgrade.sql @@ -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 revised: March 21, 2014 20:30 GMT + +-- 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`; diff --git a/sql-files/upgrades/rAthena-main-upgrade.sql b/sql-files/upgrades/rAthena-main-upgrade.sql index 165584795..9982322e5 100644 --- a/sql-files/upgrades/rAthena-main-upgrade.sql +++ b/sql-files/upgrades/rAthena-main-upgrade.sql @@ -4,7 +4,7 @@ -- 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 --- Last revised: March 21, 2014 20:30 +-- Last revised: March 21, 2014 20:30 GMT -- 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 diff --git a/sql-files/upgrades/rathena-logs-database-upgrade b/sql-files/upgrades/rathena-logs-database-upgrade deleted file mode 100644 index 7cdf58992..000000000 --- a/sql-files/upgrades/rathena-logs-database-upgrade +++ /dev/null @@ -1,13 +0,0 @@ --- 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`; diff --git a/src/char/char.c b/src/char/char.c index bf19a0012..0769067fd 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -125,6 +125,8 @@ int char_del_delay = 86400; int log_char = 1; // loggin char or not [devil] int log_inter = 1; // loggin inter or not [devil] +int char_aegis_delete = 0; // Verify if char is in guild/party or char and reacts as Aegis does (doesn't allow deletion), see char_delete2_req for more information + // Advanced subnet check [LuzZza] struct s_subnet { uint32 mask; @@ -3854,6 +3856,7 @@ int lan_subnetcheck(uint32 ip) } +/// Answers to deletion request (HC_DELETE_CHAR3_RESERVED) /// @param result /// 0 (0x718): An unknown error has occurred. /// 1: none/success @@ -3919,7 +3922,7 @@ void char_delete2_cancel_ack(int fd, int char_id, uint32 result) static void char_delete2_req(int fd, struct char_session_data* sd) {// CH: <0827>.W .L - int char_id, i; + int char_id, party_id, guild_id, i; char* data; time_t delete_date; @@ -3946,22 +3949,34 @@ static void char_delete2_req(int fd, struct char_session_data* sd) return; } -/* - // Aegis imposes these checks probably to avoid dead member - // entries in guilds/parties, otherwise they are not required. - // TODO: Figure out how these are enforced during waiting. - if( guild_id ) - {// character in guild - char_delete2_ack(fd, char_id, 4, 0); - return; - } + // This check is imposed by Aegis to avoid dead entries in databases + // _it is not needed_ as we clear data properly + // see issue: 7338 + if( char_aegis_delete ) + { + if( SQL_SUCCESS != SQL->Query(sql_handle, "SELECT `party_id`, `guild_id` FROM `%s` WHERE `char_id`='%d'", char_db, char_id) + || SQL_SUCCESS != SQL->NextRow(sql_handle) + ) + { + Sql_ShowDebug(sql_handle); + char_delete2_ack(fd, char_id, 3, 0); + return; + } + SQL->GetData(sql_handle, 0, &data, NULL); party_id = atoi(data); + SQL->GetData(sql_handle, 1, &data, NULL); guild_id = atoi(data); - if( party_id ) - {// character in party - char_delete2_ack(fd, char_id, 5, 0); - return; + if( guild_id ) + { + char_delete2_ack(fd, char_id, 4, 0); + return; + } + + if( party_id ) + { + char_delete2_ack(fd, char_id, 5, 0); + return; + } } -*/ // success delete_date = time(NULL)+char_del_delay; @@ -5258,6 +5273,8 @@ int char_config_read(const char* cfgName) char_del_level = atoi(w2); } else if (strcmpi(w1, "char_del_delay") == 0) { char_del_delay = atoi(w2); + } else if (strcmpi(w1, "char_aegis_delete") == 0) { + char_aegis_delete = atoi(w2); } else if(strcmpi(w1,"db_path")==0) { safestrncpy(db_path, w2, sizeof(db_path)); } else if (strcmpi(w1, "fame_list_alchemist") == 0) { diff --git a/src/common/db.c b/src/common/db.c index 8c15c0feb..8d6b08815 100644 --- a/src/common/db.c +++ b/src/common/db.c @@ -1846,6 +1846,8 @@ static DBData* db_obj_ensure(DBMap* self, DBKey key, DBCreateData create, ...) * @protected * @see #db_malloc_dbn(void) * @see DBMap#put + * FIXME: If this method fails shouldn't it return another value? + * Other functions rely on this to know if they were able to put something [Panikon] */ static int db_obj_put(DBMap* self, DBKey key, DBData data, DBData *out_data) { -- cgit v1.2.3-70-g09d2 From d739d89715e0800ac3c50cf46cea75735afe705c Mon Sep 17 00:00:00 2001 From: jaBote Date: Wed, 26 Mar 2014 14:00:35 +0100 Subject: Update rAthena-main-upgrade.sql Following up latest commit that alters the database (4b1cc23085b858364a332bdf03d634656778b1e6). Logs converter isn't needing an upgrade yet. --- sql-files/upgrades/rAthena-main-upgrade.sql | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sql-files/upgrades/rAthena-main-upgrade.sql') diff --git a/sql-files/upgrades/rAthena-main-upgrade.sql b/sql-files/upgrades/rAthena-main-upgrade.sql index 9982322e5..266b61fd0 100644 --- a/sql-files/upgrades/rAthena-main-upgrade.sql +++ b/sql-files/upgrades/rAthena-main-upgrade.sql @@ -4,7 +4,7 @@ -- 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 --- Last revised: March 21, 2014 20:30 GMT +-- Last revised: March 26, 2014 12:57 GMT -- 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 @@ -26,6 +26,10 @@ ALTER TABLE `char` CHANGE `moves` `slotchange` SMALLINT(3) UNSIGNED NOT NULL def ADD `font` TINYINT( 3 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `char_opt`; +-- Upgrades for table `charlog` +ALTER TABLE `charlog` ADD COLUMN `char_id` int(11) unsigned NOT NULL default '0' AFTER `account_id`; + + -- Upgrades for table `guild_storage` ALTER TABLE `guild_storage` MODIFY `bound` tinyint(1) unsigned NOT NULL default '0'; @@ -83,6 +87,7 @@ INSERT INTO `sql_updates` (`timestamp`) VALUES (1387844126); -- 2013-12-24--00-1 INSERT INTO `sql_updates` (`timestamp`) VALUES (1388854043); -- 2014-01-04--16-47.sql INSERT INTO `sql_updates` (`timestamp`) VALUES (1389028967); -- 2014-01-06--17-22.sql INSERT INTO `sql_updates` (`timestamp`) VALUES (1392832626); -- 2014-02-19--17-57.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1395789302); -- 2014-03-25--23-57.sql -- Updates to table `storage` -- cgit v1.2.3-70-g09d2 From fadc354a2114dd1ddd7d9d8f2fa114fbbff07f4d Mon Sep 17 00:00:00 2001 From: jaBote Date: Sat, 26 Apr 2014 14:29:03 +0200 Subject: Follow up c1f1ca708d54 Updated rAthena to Hercules database upgrade to latest main files. --- sql-files/upgrades/rAthena-main-upgrade.sql | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sql-files/upgrades/rAthena-main-upgrade.sql') diff --git a/sql-files/upgrades/rAthena-main-upgrade.sql b/sql-files/upgrades/rAthena-main-upgrade.sql index 266b61fd0..818cdcfb6 100644 --- a/sql-files/upgrades/rAthena-main-upgrade.sql +++ b/sql-files/upgrades/rAthena-main-upgrade.sql @@ -4,7 +4,7 @@ -- 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 --- Last revised: March 26, 2014 12:57 GMT +-- Last revised: April 26, 2014 12:29 GMT -- 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 @@ -23,7 +23,8 @@ ALTER TABLE `cart_inventory` MODIFY `bound` tinyint(1) unsigned NOT NULL default -- 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' AFTER `slotchange`, - ADD `font` TINYINT( 3 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `char_opt`; + ADD `font` TINYINT( 3 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `char_opt`, + MODIFY `uniqueitem_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; -- Upgrades for table `charlog` @@ -88,6 +89,8 @@ INSERT INTO `sql_updates` (`timestamp`) VALUES (1388854043); -- 2014-01-04--16-4 INSERT INTO `sql_updates` (`timestamp`) VALUES (1389028967); -- 2014-01-06--17-22.sql INSERT INTO `sql_updates` (`timestamp`) VALUES (1392832626); -- 2014-02-19--17-57.sql INSERT INTO `sql_updates` (`timestamp`) VALUES (1395789302); -- 2014-03-25--23-57.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1396893866); -- 2014-04-07--22-04.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1398477600); -- 2014-04-26--10-00.sql -- Updates to table `storage` -- cgit v1.2.3-70-g09d2 From 3bd57cf4858696b2586543098bc9eeac70a1854e Mon Sep 17 00:00:00 2001 From: Haru Date: Tue, 13 May 2014 14:26:12 +0200 Subject: Fixed some charset issues - Fixed files with mixed character set or invalid CP949 characters. - Uncommented '#music' script in the_sign_quest.txt (now the soundeffect filename should be fixed). - Added a note to the header of CP949 files not to read or save them as UTF8, since it'd break their encoding. It should be safe enough to read them as EUC-KR if your text editor doesn't offer CP949 as an option. - Added FIXME notes about untranslated strings in assassin_skills.txt and WolfchevLaboratory.txt. Signed-off-by: Haru --- conf/battle/battle.conf | 2 +- npc/events/christmas_2008.txt | 2 ++ npc/jobs/2-1/priest.txt | 2 ++ npc/other/fortune.txt | 2 ++ npc/quests/quests_moscovia.txt | 2 ++ npc/quests/skills/assassin_skills.txt | 4 ++++ npc/quests/the_sign_quest.txt | 6 +++--- npc/re/cities/dicastes.txt | 8 +++++--- npc/re/instances/WolfchevLaboratory.txt | 3 +++ npc/re/quests/eden/86-90.txt | 2 ++ npc/re/quests/eden/91-99.txt | 2 ++ npc/re/quests/quests_dicastes.txt | 2 ++ npc/re/quests/quests_malangdo.txt | 2 ++ npc/re/quests/quests_mora.txt | 16 +++++++++------- npc/re/warps/cities/dicastes.txt | 2 ++ sql-files/upgrades/rAthena-main-upgrade.sql | 2 +- src/common/timer.c | 2 +- 17 files changed, 45 insertions(+), 16 deletions(-) (limited to 'sql-files/upgrades/rAthena-main-upgrade.sql') diff --git a/conf/battle/battle.conf b/conf/battle/battle.conf index 5b72f5ff9..29aa803a0 100644 --- a/conf/battle/battle.conf +++ b/conf/battle/battle.conf @@ -99,7 +99,7 @@ vit_penalty_num: 5 // eg: 10 + 50 def becomes 0 + (10*type + 50) weapon_defense_type: 0 -//MDEF‚same as above....(MDEF*value) +// MDEF, same as above....(MDEF*value) magic_defense_type: 0 // Change attacker's direction to face opponent on every attack? (Note 3) diff --git a/npc/events/christmas_2008.txt b/npc/events/christmas_2008.txt index 11fd1dea1..192bf25ec 100644 --- a/npc/events/christmas_2008.txt +++ b/npc/events/christmas_2008.txt @@ -4,6 +4,8 @@ //= Kisuka //===== Current Version: ===================================== //= 1.1 +//===== File Encoding ======================================== +//= CP-949 (EUC-KR compatible). Do NOT read/save it as UTF-8. //===== Description: ========================================= //= iRO Christmas Event. (2008) //= Create Music Box and Cake. diff --git a/npc/jobs/2-1/priest.txt b/npc/jobs/2-1/priest.txt index a06af96a1..735bb0d54 100644 --- a/npc/jobs/2-1/priest.txt +++ b/npc/jobs/2-1/priest.txt @@ -6,6 +6,8 @@ //= Further bugfixed and tested by Lupus //===== Current Version: ===================================== //= 2.6 +//===== File Encoding ======================================== +//= CP-949 (EUC-KR compatible). Do NOT read/save it as UTF-8. //===== Description: ========================================= //= [Official Conversion] //= Job Change quest for Priest class. diff --git a/npc/other/fortune.txt b/npc/other/fortune.txt index b622c1fac..a596377d1 100644 --- a/npc/other/fortune.txt +++ b/npc/other/fortune.txt @@ -4,6 +4,8 @@ //= L0ne_W0lf //===== Current Version: ===================================== //= 1.0 +//===== File Encoding ======================================== +//= CP-949 (EUC-KR compatible). Do NOT read/save it as UTF-8. //===== Description: ========================================= //= [Official Conversion] //= Fortune teller NPC. Displays random Card image. diff --git a/npc/quests/quests_moscovia.txt b/npc/quests/quests_moscovia.txt index 740f1b038..508a14580 100644 --- a/npc/quests/quests_moscovia.txt +++ b/npc/quests/quests_moscovia.txt @@ -4,6 +4,8 @@ //= Kisuka //===== Current Version: ===================================== //= 2.3 +//===== File Encoding ======================================== +//= CP-949 (EUC-KR compatible). Do NOT read/save it as UTF-8. //===== Description: ========================================= //= Quests for Moscovia. //= The Moving Island, Help Mikhail, Acorn Exchange, diff --git a/npc/quests/skills/assassin_skills.txt b/npc/quests/skills/assassin_skills.txt index 8ff7da04c..674090afa 100644 --- a/npc/quests/skills/assassin_skills.txt +++ b/npc/quests/skills/assassin_skills.txt @@ -4,6 +4,8 @@ //= Lupus, Reddozen //===== Current Version: ===================================== //= 1.5 +//===== File Encoding ======================================== +//= CP-949 (EUC-KR compatible). Do NOT read/save it as UTF-8. //===== Description: ========================================= //= [Official Conversion] //= Quests for skills: Venom Knife, Sonic Acceleration @@ -950,6 +952,8 @@ OnTouch: } } +// FIXME[Haru]: Why do we have a Korean name here? Can anyone translate it? +// Google translate says ¡¡ (jingjing) = Whining, but it doesn't make much sense to me. moc_pryd04,85,96,0 script ¡¡#crypt -1,3,3,{ OnTouch: if (ASSN_SK == 4) { diff --git a/npc/quests/the_sign_quest.txt b/npc/quests/the_sign_quest.txt index 9ede5352e..83704c8e5 100644 --- a/npc/quests/the_sign_quest.txt +++ b/npc/quests/the_sign_quest.txt @@ -4,6 +4,8 @@ //= SinSloth, MasterOfMuppets, Kargha //===== Current Version: ===================================== //= 3.9 +//===== File Encoding ======================================== +//= CP-949 (EUC-KR compatible). Do NOT read/save it as UTF-8. //===== Description: ========================================= //= [Official Conversion] //= Quest for opening the doors to Geffenia. @@ -3090,13 +3092,11 @@ OnTouch: end; } -/* Currently broken. prt_maze02,25,161,0 script #music -1,7,7,{ OnTouch: - soundeffect "effect\\¼®¾çÀÇ ¾î½Ø½Å.wav",1; + soundeffect "effect\\ ؽ.wav",1; end; } -*/ prt_maze02,132,132,0 script #skill -1,{ OnEnable: diff --git a/npc/re/cities/dicastes.txt b/npc/re/cities/dicastes.txt index 1c80f9567..efd1c6efc 100644 --- a/npc/re/cities/dicastes.txt +++ b/npc/re/cities/dicastes.txt @@ -4,6 +4,8 @@ //= Gennosuke Kouga, Muad_Dib //===== Current Version: ===================================== //= 1.3 +//===== File Encoding ======================================== +//= CP-949 (EUC-KR compatible). Do NOT read/save it as UTF-8. //===== Description: ========================================= //= [Official Conversion] //= El Dicastes Town Script @@ -82,8 +84,8 @@ dicastes01,234,158,0 script Training Galten#a 4_MAN_GALTUN,{ mes "if I keep up with my training every day."; close; } - mes " "; - mes " "; + mes " "; + mes " "; next; mes "Don't know what it means."; close; @@ -128,7 +130,7 @@ dicastes01,248,129,0 script Training Galten#d 4_MAN_GALTUN,{ close; } mes " "; - mes " "; + mes " "; next; mes "Don't know what it means."; close; diff --git a/npc/re/instances/WolfchevLaboratory.txt b/npc/re/instances/WolfchevLaboratory.txt index 4498ebdd0..114555547 100644 --- a/npc/re/instances/WolfchevLaboratory.txt +++ b/npc/re/instances/WolfchevLaboratory.txt @@ -4,6 +4,8 @@ //= Kisuka (1.0) //===== Current Version: ======================================================= //= 1.0.0 +//===== File Encoding ========================================================== +//= CP-949 (EUC-KR compatible). Do NOT read/save it as UTF-8. //===== Description: =========================================================== //= Defeat Wolfchev's human experimentations. //===== Additional Comments: =================================================== @@ -566,6 +568,7 @@ lighthalzen,342,291,4 script Weird old man#Bio4Reward 4_M_EINOLD,{ break; case 4: mes "<>"; + // FIXME[Haru]: Anyone knows what ¹ßÈ­ means? mes "When doing short distance attack, cast ¹ßÈ­ to the player and to the enemy with a certain chance."; mes "Two-Handed Axe / ATK 250 / Weight 190 / Fire Property / Weapon Lv 4 / Required Lv 95 / Socket 1 / for High Swordman/Merchant Classes"; callsub L_Reward, Ygnus_Stale, 50, 100, 35; diff --git a/npc/re/quests/eden/86-90.txt b/npc/re/quests/eden/86-90.txt index 7746d6be3..01c8fec29 100644 --- a/npc/re/quests/eden/86-90.txt +++ b/npc/re/quests/eden/86-90.txt @@ -4,6 +4,8 @@ //= Chilly //===== Current Version: ===================================== //= 1.3 +//===== File Encoding ======================================== +//= CP-949 (EUC-KR compatible). Do NOT read/save it as UTF-8. //===== Description: ========================================= //= Repetable Quests for Players between Baselevel 86 - 90. //===== Additional Comments: ================================= diff --git a/npc/re/quests/eden/91-99.txt b/npc/re/quests/eden/91-99.txt index 2985463bf..e6744e80f 100644 --- a/npc/re/quests/eden/91-99.txt +++ b/npc/re/quests/eden/91-99.txt @@ -4,6 +4,8 @@ //= Chilly //===== Current Version: ===================================== //= 1.3 +//===== File Encoding ======================================== +//= CP-949 (EUC-KR compatible). Do NOT read/save it as UTF-8. //===== Description: ========================================= //= Repetable Quests for Players between Baselevel 91 - 99. //===== Additional Comments: ================================= diff --git a/npc/re/quests/quests_dicastes.txt b/npc/re/quests/quests_dicastes.txt index 7afe04039..9478ba1c9 100644 --- a/npc/re/quests/quests_dicastes.txt +++ b/npc/re/quests/quests_dicastes.txt @@ -4,6 +4,8 @@ //= Gennosuke Kouga, Muad_Dib //===== Current Version: ===================================== //= 2.3 +//===== File Encoding ======================================== +//= CP-949 (EUC-KR compatible). Do NOT read/save it as UTF-8. //===== Description: ========================================= //= [Official Conversion] //= Quest NPCs related to Dewata: diff --git a/npc/re/quests/quests_malangdo.txt b/npc/re/quests/quests_malangdo.txt index 5593300ec..0511a1e55 100644 --- a/npc/re/quests/quests_malangdo.txt +++ b/npc/re/quests/quests_malangdo.txt @@ -4,6 +4,8 @@ //= Muad_Dib //===== Current Version: ===================================== //= 1.6 +//===== File Encoding ======================================== +//= CP-949 (EUC-KR compatible). Do NOT read/save it as UTF-8. //===== Description: ========================================= //= [Official Conversion] //= Quest NPCs related to Malangdo: diff --git a/npc/re/quests/quests_mora.txt b/npc/re/quests/quests_mora.txt index 1d7e9bbd0..1c1e64046 100644 --- a/npc/re/quests/quests_mora.txt +++ b/npc/re/quests/quests_mora.txt @@ -4,6 +4,8 @@ //= Euphy //===== Current Version: ===================================== //= 1.1 +//===== File Encoding ======================================== +//= CP-949 (EUC-KR compatible). Do NOT read/save it as UTF-8. //===== Description: ========================================= //= [Official Conversion] //= Quest NPCs related to Mora: @@ -3382,26 +3384,26 @@ L_ShowReport: mes "[Experimental Results]"; mes "*** Researcher - Inffle"; mes "*** Research Assistant - "+strcharinfo(0); - mes ""; + mes " "; mes ""; mes "*** Bath of Mora Village"; - mes ""; + mes " "; mes ""; mes "To investigate the mysterious power of the bath water"; mes "and to find out ways to better utilize"; mes "the water."; - mes ""; + mes " "; mes ""; mes "1. Obtained an unidentified DNA sample."; mes "Obtained a sample of an unidentified DNA,"; mes "and collected more samples to look further into it."; - mes ""; + mes " "; mes "2. A comparison analysis on the unidentified DNA"; mes "Concluded that the DNA belongs to"; mes "an unidentified creature living in the bath water."; mes "combine and result in"; mes "from the swordfish DNA."; - mes ""; + mes " "; mes "3. Research on the puddles around the village"; mes "From the four puddles around the village,"; mes "confirmed that the testing substances were"; @@ -3409,9 +3411,9 @@ L_ShowReport: mes "It is thought that the four puddles"; mes "combine and result in"; mes "the mysterious power."; - mes ""; + mes " "; mes ""; - mes "*** Temperature ***** 33.5 "; + mes "*** Temperature ***** 33.5"; mes "*** PH ************ 9.8"; mes "*** Solid residues *** 176"; mes "*** K+ ************ 0,23"; diff --git a/npc/re/warps/cities/dicastes.txt b/npc/re/warps/cities/dicastes.txt index 15e64a31f..52c641bc4 100644 --- a/npc/re/warps/cities/dicastes.txt +++ b/npc/re/warps/cities/dicastes.txt @@ -4,6 +4,8 @@ //= Chilly, Muad_Dib //===== Current Version: ===================================== //= 1.3 +//===== File Encoding ======================================== +//= CP-949 (EUC-KR compatible). Do NOT read/save it as UTF-8. //===== Description: ========================================= //= Warp Points for El Dicastes //===== Additional Comments: ================================= diff --git a/sql-files/upgrades/rAthena-main-upgrade.sql b/sql-files/upgrades/rAthena-main-upgrade.sql index 818cdcfb6..706c07740 100644 --- a/sql-files/upgrades/rAthena-main-upgrade.sql +++ b/sql-files/upgrades/rAthena-main-upgrade.sql @@ -6,7 +6,7 @@ -- Apply in the same database you applied your main.sql -- Last revised: April 26, 2014 12:29 GMT --- Drop table contents from ´sc_data´ since we use a different status order than rAthena +-- 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 -- You can disable this, but this is a SECURITY MEASURE -- This will remove even jailed status from users! diff --git a/src/common/timer.c b/src/common/timer.c index 10f14b0f2..5d67455dc 100644 --- a/src/common/timer.c +++ b/src/common/timer.c @@ -180,7 +180,7 @@ static int64 sys_tick(void) { // Monotinic clock: Implementation-defined. // Clock that cannot be set and represents monotonic time since some // unspecified starting point. This clock is not affected by - // discontin‐uous jumps in the system time (e.g., if the system + // discontinuous jumps in the system time (e.g., if the system // administrator manually changes the clock), but is affected by // the incremental adjustments performed by adjtime(3) and NTP. struct timespec tval; -- cgit v1.2.3-70-g09d2 From 40e9c131cb8993b45d8c08f185393041bfac5b8e Mon Sep 17 00:00:00 2001 From: jaBote Date: Fri, 23 May 2014 13:46:00 +0200 Subject: Update rAthena-main-upgrade.sql Following up 3591de7e7ac2db4e3eeaa9bad2615648e7f94b3a. Upgrader should be up to date as of now. --- sql-files/upgrades/rAthena-main-upgrade.sql | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sql-files/upgrades/rAthena-main-upgrade.sql') diff --git a/sql-files/upgrades/rAthena-main-upgrade.sql b/sql-files/upgrades/rAthena-main-upgrade.sql index 706c07740..cc198e834 100644 --- a/sql-files/upgrades/rAthena-main-upgrade.sql +++ b/sql-files/upgrades/rAthena-main-upgrade.sql @@ -50,6 +50,10 @@ ALTER TABLE `mapreg` MODIFY `varname` varchar(32) BINARY NOT NULL, ADD PRIMARY KEY (`varname`,`index`); +-- Upgrades for table `sc_data` +ALTER TABLE `pet` CHANGE `incuvate` `incubate` int(11) unsigned NOT NULL default '0'; + + -- Upgrades for table `sc_data` ALTER TABLE `sc_data` ADD PRIMARY KEY (`account_id`,`char_id`,`type`); @@ -91,6 +95,7 @@ INSERT INTO `sql_updates` (`timestamp`) VALUES (1392832626); -- 2014-02-19--17-5 INSERT INTO `sql_updates` (`timestamp`) VALUES (1395789302); -- 2014-03-25--23-57.sql INSERT INTO `sql_updates` (`timestamp`) VALUES (1396893866); -- 2014-04-07--22-04.sql INSERT INTO `sql_updates` (`timestamp`) VALUES (1398477600); -- 2014-04-26--10-00.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1400256139); -- 2014-05-17--00-06.sql -- Updates to table `storage` -- cgit v1.2.3-70-g09d2 From ef8700dfa9e21acf1963fd8a139e79bf5dec0dd9 Mon Sep 17 00:00:00 2001 From: Shido Date: Fri, 30 May 2014 10:15:22 +0800 Subject: Updated sql-upgrade files. --- sql-files/upgrades/2013-02-14--16-15.sql | 4 +- sql-files/upgrades/2013-02-15--18-06.sql | 2 +- sql-files/upgrades/2013-03-05--01-05.sql | 2 +- sql-files/upgrades/2013-03-09--01-56.sql | 4 +- sql-files/upgrades/2013-04-16--01-24.sql | 2 +- sql-files/upgrades/2013-04-16--02-15.sql | 4 +- sql-files/upgrades/2013-10-09--21-38.sql | 2 +- sql-files/upgrades/2013-10-10--16-36.sql | 6 +- sql-files/upgrades/2013-10-27--16-47.sql | 8 +- sql-files/upgrades/2013-10-30--19-53.sql | 6 +- sql-files/upgrades/2013-10-30--21-12.sql | 2 +- sql-files/upgrades/2013-10-31--07-49.sql | 4 +- sql-files/upgrades/2013-11-09--00-03.sql | 6 +- sql-files/upgrades/2013-11-15--00-06.sql | 80 +++++++++--------- sql-files/upgrades/2013-11-16--07-49.sql | 2 +- sql-files/upgrades/2013-11-18--08-23.sql | 4 +- sql-files/upgrades/2013-12-24--00-15.sql | 8 +- sql-files/upgrades/2014-01-04--16-47.sql | 64 +++++++------- sql-files/upgrades/2014-01-06--17-22.sql | 20 ++--- sql-files/upgrades/2014-02-19--17-57.sql | 2 +- sql-files/upgrades/2014-03-25--23-57.sql | 2 +- sql-files/upgrades/2014-04-07--22-04.sql | 2 +- sql-files/upgrades/2014-04-26--10-00.sql | 2 +- sql-files/upgrades/eathena-upgrade.sql | 104 +++++++++++++++-------- sql-files/upgrades/rAthena-main-upgrade.sql | 125 ++++++++++++---------------- 25 files changed, 242 insertions(+), 225 deletions(-) (limited to 'sql-files/upgrades/rAthena-main-upgrade.sql') diff --git a/sql-files/upgrades/2013-02-14--16-15.sql b/sql-files/upgrades/2013-02-14--16-15.sql index 9eac1a5e8..b7db70d43 100644 --- a/sql-files/upgrades/2013-02-14--16-15.sql +++ b/sql-files/upgrades/2013-02-14--16-15.sql @@ -1,7 +1,7 @@ #1360858500 CREATE TABLE IF NOT EXISTS `sql_updates` ( - `timestamp` int(11) unsigned NOT NULL, - `ignored` enum('Yes','No') NOT NULL DEFAULT 'No' + `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 index 836655095..efb0b2ad6 100644 --- a/sql-files/upgrades/2013-02-15--18-06.sql +++ b/sql-files/upgrades/2013-02-15--18-06.sql @@ -1,3 +1,3 @@ #1360951560 -ALTER TABLE `sql_updates` ADD PRIMARY KEY(`timestamp`); +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 index a280dc8dd..b1a0e4029 100644 --- a/sql-files/upgrades/2013-03-05--01-05.sql +++ b/sql-files/upgrades/2013-03-05--01-05.sql @@ -1,3 +1,3 @@ #1362445531 -ALTER TABLE `login` ADD `character_slots` TINYINT( 3 ) UNSIGNED NOT NULL; +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-09--01-56.sql b/sql-files/upgrades/2013-03-09--01-56.sql index c35777283..6edfa79c9 100644 --- a/sql-files/upgrades/2013-03-09--01-56.sql +++ b/sql-files/upgrades/2013-03-09--01-56.sql @@ -1,4 +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'; +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-04-16--01-24.sql b/sql-files/upgrades/2013-04-16--01-24.sql index a55eebe1a..d011e27e3 100644 --- a/sql-files/upgrades/2013-04-16--01-24.sql +++ b/sql-files/upgrades/2013-04-16--01-24.sql @@ -1,3 +1,3 @@ #1366075474 -#Info http://hercules.ws/board/topic/410-skill-script-command-updatefix/ +-- Info http://hercules.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 index 3a0895204..458d1dc37 100644 --- a/sql-files/upgrades/2013-04-16--02-15.sql +++ b/sql-files/upgrades/2013-04-16--02-15.sql @@ -1,4 +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.. +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 index 918f8cd21..d8854bcdf 100644 --- a/sql-files/upgrades/2013-10-09--21-38.sql +++ b/sql-files/upgrades/2013-10-09--21-38.sql @@ -1,3 +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'; +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 index 764e632aa..88db7609e 100644 --- a/sql-files/upgrades/2013-10-10--16-36.sql +++ b/sql-files/upgrades/2013-10-10--16-36.sql @@ -1,7 +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`) + `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 index 81131726c..2a9a73f31 100644 --- a/sql-files/upgrades/2013-10-27--16-47.sql +++ b/sql-files/upgrades/2013-10-27--16-47.sql @@ -1,6 +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'; +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 index 6bff8eaa5..6e89015e9 100644 --- a/sql-files/upgrades/2013-10-30--19-53.sql +++ b/sql-files/upgrades/2013-10-30--19-53.sql @@ -1,5 +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'; +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 index 33f052326..e0fbda874 100644 --- a/sql-files/upgrades/2013-10-30--21-12.sql +++ b/sql-files/upgrades/2013-10-30--21-12.sql @@ -1,3 +1,3 @@ #1383167577 -ALTER TABLE `char` ADD `font` TINYINT( 3 ) UNSIGNED NOT NULL DEFAULT '0'; +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 index 607753d54..25f489f57 100644 --- a/sql-files/upgrades/2013-10-31--07-49.sql +++ b/sql-files/upgrades/2013-10-31--07-49.sql @@ -1,6 +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 `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 index 7ca887653..92fe1b76b 100644 --- a/sql-files/upgrades/2013-11-09--00-03.sql +++ b/sql-files/upgrades/2013-11-09--00-03.sql @@ -1,5 +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'; +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 index 09749bfc3..dafc5615a 100644 --- a/sql-files/upgrades/2013-11-15--00-06.sql +++ b/sql-files/upgrades/2013-11-15--00-06.sql @@ -4,27 +4,27 @@ -- 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; +-- 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; +-- 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 ] @@ -75,27 +75,27 @@ BEGIN 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_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') $$ +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 $$ diff --git a/sql-files/upgrades/2013-11-16--07-49.sql b/sql-files/upgrades/2013-11-16--07-49.sql index 15c740fd0..fce74aab1 100644 --- a/sql-files/upgrades/2013-11-16--07-49.sql +++ b/sql-files/upgrades/2013-11-16--07-49.sql @@ -1,3 +1,3 @@ #1384588175 -ALTER TABLE `char` ADD COLUMN `unban_time` int(11) unsigned NOT NULL default '0'; +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 index d5da5fd95..d7100d78a 100644 --- a/sql-files/upgrades/2013-11-18--08-23.sql +++ b/sql-files/upgrades/2013-11-18--08-23.sql @@ -4,7 +4,7 @@ -- 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`; +-- ALTER TABLE item_db2 ADD COLUMN `bindonequip` TINYINT(1) UNSIGNED DEFAULT NULL AFTER `view`; -- INSERT INTO `sql_updates` (`timestamp`) VALUES (1384763034); -- -- [ End ] @@ -55,7 +55,7 @@ BEGIN END $$ -CALL alter_if_not_exists('item_db2', 'bindonequip', 'ADD COLUMN', 'tinyint(1) unsigned DEFAULT NULL AFTER `view`') $$ +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 $$ diff --git a/sql-files/upgrades/2013-12-24--00-15.sql b/sql-files/upgrades/2013-12-24--00-15.sql index b1f8d019d..2de4771a6 100644 --- a/sql-files/upgrades/2013-12-24--00-15.sql +++ b/sql-files/upgrades/2013-12-24--00-15.sql @@ -1,8 +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`) + `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 index 53320a712..40be437d9 100644 --- a/sql-files/upgrades/2014-01-04--16-47.sql +++ b/sql-files/upgrades/2014-01-04--16-47.sql @@ -2,53 +2,53 @@ 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; +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`), + `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`), + `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`), + `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`), + `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`), + `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`), + `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 '%$'; @@ -57,5 +57,5 @@ INSERT INTO `char_reg_num_db` (`char_id`, `key`, `index`, `value`) SELECT `char_ 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`; +# 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 index 0ba9cb69f..e3ca8935e 100644 --- a/sql-files/upgrades/2014-01-06--17-22.sql +++ b/sql-files/upgrades/2014-01-06--17-22.sql @@ -1,16 +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`) + `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`) + `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 index 74cfdfe37..63abc335f 100644 --- a/sql-files/upgrades/2014-02-19--17-57.sql +++ b/sql-files/upgrades/2014-02-19--17-57.sql @@ -1,4 +1,4 @@ #1392832626 DELETE FROM `sc_data` WHERE `tick` = '-1'; -ALTER TABLE `sc_data` ADD PRIMARY KEY (`account_id`,`char_id`,`type`); +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 index f5c3aad00..40d3fb2fc 100644 --- a/sql-files/upgrades/2014-03-25--23-57.sql +++ b/sql-files/upgrades/2014-03-25--23-57.sql @@ -1,3 +1,3 @@ #1395789302 -ALTER TABLE `charlog` ADD COLUMN `char_id` int(11) unsigned NOT NULL default '0' AFTER `account_id`; +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 index 9e33d6aec..56c54eac4 100644 --- a/sql-files/upgrades/2014-04-07--22-04.sql +++ b/sql-files/upgrades/2014-04-07--22-04.sql @@ -1,3 +1,3 @@ #1396893866 -ALTER TABLE `char` ADD COLUMN `uniqueitem_counter` bigint(20) NOT NULL AFTER `unban_time`; +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 index de3fbd4c8..0c0b571e0 100644 --- a/sql-files/upgrades/2014-04-26--10-00.sql +++ b/sql-files/upgrades/2014-04-26--10-00.sql @@ -1,3 +1,3 @@ #1398477600 -ALTER TABLE `char` CHANGE COLUMN `uniqueitem_counter` `uniqueitem_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' ; +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/eathena-upgrade.sql b/sql-files/upgrades/eathena-upgrade.sql index 63a0d1151..20678dc9f 100644 --- a/sql-files/upgrades/eathena-upgrade.sql +++ b/sql-files/upgrades/eathena-upgrade.sql @@ -1,78 +1,114 @@ -##### -#Upgrade file to be used when going from eAthena to Hercules -#Note: If you're not up to date with eAthena, go through their upgrade files first and run them before this file. -#Note: After runing this file run Hercules upgrade files. -##### +-- +-- Upgrade file to be used when going from eAthena to Hercules +-- Note: If you're not up to date with eAthena, go through their upgrade files first and run them before this file. +-- Note: After runing this file run Hercules upgrade files. +-- + ALTER TABLE `global_reg_value` MODIFY `type` TINYINT(1) UNSIGNED NOT NULL DEFAULT '3'; + -- Adds 'I' and 'X' to `type` in `picklog` table ALTER TABLE `picklog` MODIFY `type` ENUM('M','P','L','T','V','S','N','C','A','R','G','E','B','O','I','X') NOT NULL DEFAULT 'P'; + -- Adds 'D' and 'U' to `type` in `picklog` table 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'; + -- `ExpPer` column removed from `mob_db` and `mob_db2` tables ALTER TABLE `mob_db` DROP COLUMN `ExpPer`; ALTER TABLE `mob_db2` DROP COLUMN `ExpPer`; + -- Rename `level` column to `group_id` in `login` table ALTER TABLE `login` CHANGE COLUMN `level` `group_id` TINYINT(3) NOT NULL DEFAULT '0'; + -- Adds 'I' to `type` in `zenylog` ALTER TABLE `zenylog` MODIFY `type` ENUM('M','T','V','S','N','A','E','B','I') NOT NULL DEFAULT 'S'; -ALTER TABLE `char` ADD COLUMN `elemental_id` int(11) unsigned NOT NULL default '0'; + +ALTER TABLE `char` ADD COLUMN `elemental_id` INT(11) UNSIGNED NOT NULL DEFAULT '0'; + CREATE TABLE IF NOT EXISTS `elemental` ( - `ele_id` int(11) unsigned NOT NULL auto_increment, - `char_id` int(11) NOT NULL, - `class` mediumint(9) unsigned NOT NULL default '0', - `mode` int(11) unsigned NOT NULL default '1', - `hp` int(12) NOT NULL default '1', - `sp` int(12) NOT NULL default '1', - `max_hp` mediumint(8) unsigned NOT NULL default '0', - `max_sp` mediumint(6) unsigned NOT NULL default '0', - `str` smallint(4) unsigned NOT NULL default '0', - `agi` smallint(4) unsigned NOT NULL default '0', - `vit` smallint(4) unsigned NOT NULL default '0', - `int` smallint(4) unsigned NOT NULL default '0', - `dex` smallint(4) unsigned NOT NULL default '0', - `luk` smallint(4) unsigned NOT NULL default '0', - `life_time` int(11) NOT NULL default '0', - PRIMARY KEY (`ele_id`) + `ele_id` INT(11) UNSIGNED NOT NULL auto_increment, + `char_id` INT(11) NOT NULL, + `class` MEDIUMINT(9) UNSIGNED NOT NULL DEFAULT '0', + `mode` INT(11) UNSIGNED NOT NULL DEFAULT '1', + `hp` INT(12) NOT NULL DEFAULT '1', + `sp` INT(12) NOT NULL DEFAULT '1', + `max_hp` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0', + `max_sp` MEDIUMINT(6) UNSIGNED NOT NULL DEFAULT '0', + `str` SMALLINT(4) UNSIGNED NOT NULL DEFAULT '0', + `agi` SMALLINT(4) UNSIGNED NOT NULL DEFAULT '0', + `vit` SMALLINT(4) UNSIGNED NOT NULL DEFAULT '0', + `INT` SMALLINT(4) UNSIGNED NOT NULL DEFAULT '0', + `dex` SMALLINT(4) UNSIGNED NOT NULL DEFAULT '0', + `luk` SMALLINT(4) UNSIGNED NOT NULL DEFAULT '0', + `life_time` INT(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`ele_id`) ) ENGINE=MyISAM; + -- Adds 'D' to `type` in `zenylog` ALTER TABLE `zenylog` MODIFY `type` ENUM('M','T','V','S','N','A','E','B','I','D') NOT NULL DEFAULT 'S'; + ALTER TABLE `char` ADD CONSTRAINT `name_key` UNIQUE (`name`); + ALTER TABLE `inventory` ADD COLUMN `favorite` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `expire_time`; + ALTER TABLE `item_db_re` CHANGE `equip_level` `equip_level` VARCHAR(10) DEFAULT ''; + ALTER TABLE `item_db_re` MODIFY COLUMN `atk:matk` VARCHAR(11) DEFAULT ''; + ALTER TABLE `item_db_re` MODIFY COLUMN `defence` SMALLINT(5) UNSIGNED DEFAULT NULL; + ALTER TABLE `homunculus` ADD `prev_class` MEDIUMINT( 9 ) NOT NULL AFTER `class` + ALTER TABLE `item_db_re` MODIFY `defence` SMALLINT(5) DEFAULT NULL; + ALTER TABLE `item_db` MODIFY `defence` SMALLINT(5) DEFAULT NULL; + ALTER TABLE `zenylog` MODIFY `type` ENUM('T','V','P','M','S','N','D','C','A','E','I','B') NOT NULL DEFAULT 'S'; + ALTER TABLE `elemental` CHANGE COLUMN `str` `atk1` MEDIUMINT(6) UNSIGNED NOT NULL DEFAULT 0, - CHANGE COLUMN `agi` `atk2` MEDIUMINT(6) UNSIGNED NOT NULL DEFAULT 0, - CHANGE COLUMN `vit` `matk` MEDIUMINT(6) UNSIGNED NOT NULL DEFAULT 0, - CHANGE COLUMN `int` `aspd` SMALLINT(4) UNSIGNED NOT NULL DEFAULT 0, - CHANGE COLUMN `dex` `def` SMALLINT(4) UNSIGNED NOT NULL DEFAULT 0, - CHANGE COLUMN `luk` `mdef` SMALLINT(4) UNSIGNED NOT NULL DEFAULT 0, - CHANGE COLUMN `life_time` `flee` SMALLINT(4) UNSIGNED NOT NULL DEFAULT 0, - ADD COLUMN `hit` SMALLINT(4) UNSIGNED NOT NULL DEFAULT 0 AFTER `flee`, - ADD COLUMN `life_time` INT(11) NOT NULL DEFAULT 0 AFTER `hit`; + CHANGE COLUMN `agi` `atk2` MEDIUMINT(6) UNSIGNED NOT NULL DEFAULT 0, + CHANGE COLUMN `vit` `matk` MEDIUMINT(6) UNSIGNED NOT NULL DEFAULT 0, + CHANGE COLUMN `INT` `aspd` SMALLINT(4) UNSIGNED NOT NULL DEFAULT 0, + CHANGE COLUMN `dex` `def` SMALLINT(4) UNSIGNED NOT NULL DEFAULT 0, + CHANGE COLUMN `luk` `mdef` SMALLINT(4) UNSIGNED NOT NULL DEFAULT 0, + CHANGE COLUMN `life_time` `flee` SMALLINT(4) UNSIGNED NOT NULL DEFAULT 0, + ADD COLUMN `hit` SMALLINT(4) UNSIGNED NOT NULL DEFAULT 0 AFTER `flee`, + ADD COLUMN `life_time` INT(11) NOT NULL DEFAULT 0 AFTER `hit`; + ALTER TABLE `picklog` ADD `nsiuid` BIGINT NOT NULL DEFAULT '0' AFTER `card3`; + CREATE TABLE IF NOT EXISTS `interreg` ( - `varname` varchar(11) NOT NULL, - `value` varchar(20) NOT NULL, + `varname` VARCHAR(11) NOT NULL, + `value` VARCHAR(20) NOT NULL, PRIMARY KEY (`varname`) ) ENGINE=InnoDB; -INSERT INTO `interreg` (`varname`, `value`) VALUES -('nsiuid', '0'); + +INSERT INTO `interreg` (`varname`, `value`) VALUES ('nsiuid', '0'); + ALTER TABLE `auction` ADD `nsiuid` BIGINT NOT NULL DEFAULT '0'; + ALTER TABLE `cart_inventory` ADD `nsiuid` BIGINT NOT NULL DEFAULT '0'; + ALTER TABLE `guild_storage` ADD `nsiuid` BIGINT NOT NULL DEFAULT '0'; + ALTER TABLE `inventory` ADD `nsiuid` BIGINT NOT NULL DEFAULT '0'; + ALTER TABLE `mail` ADD `nsiuid` BIGINT NOT NULL DEFAULT '0'; + ALTER TABLE `storage` ADD `nsiuid` BIGINT NOT NULL DEFAULT '0'; + ALTER TABLE `picklog` CHANGE `nsiuid` `unique_id` BIGINT( 20 ) NOT NULL DEFAULT '0'; + UPDATE `interreg` SET `varname` = 'unique_id' WHERE `interreg`.`varname` = 'nsiuid'; + ALTER TABLE `auction` CHANGE `nsiuid` `unique_id` BIGINT( 20 ) NOT NULL DEFAULT '0'; + ALTER TABLE `cart_inventory` CHANGE `nsiuid` `unique_id` BIGINT( 20 ) NOT NULL DEFAULT '0'; + ALTER TABLE `guild_storage` CHANGE `nsiuid` `unique_id` BIGINT( 20 ) NOT NULL DEFAULT '0'; + ALTER TABLE `inventory` CHANGE `nsiuid` `unique_id` BIGINT( 20 ) NOT NULL DEFAULT '0'; + ALTER TABLE `mail` CHANGE `nsiuid` `unique_id` BIGINT( 20 ) NOT NULL DEFAULT '0'; + ALTER TABLE `storage` CHANGE `nsiuid` `unique_id` BIGINT( 20 ) NOT NULL DEFAULT '0'; + diff --git a/sql-files/upgrades/rAthena-main-upgrade.sql b/sql-files/upgrades/rAthena-main-upgrade.sql index cc198e834..37b961d54 100644 --- a/sql-files/upgrades/rAthena-main-upgrade.sql +++ b/sql-files/upgrades/rAthena-main-upgrade.sql @@ -15,40 +15,32 @@ 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'; - +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' AFTER `slotchange`, - ADD `font` TINYINT( 3 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `char_opt`, +ALTER TABLE `char` CHANGE `moves` `slotchange` SMALLINT(3) UNSIGNED NOT NULL DEFAULT '0', + ADD `char_opt` INT(11) UNSIGNED NOT NULL DEFAULT '0' AFTER `slotchange`, + ADD `font` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `char_opt`, MODIFY `uniqueitem_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; - -- Upgrades for table `charlog` -ALTER TABLE `charlog` ADD COLUMN `char_id` int(11) unsigned NOT NULL default '0' AFTER `account_id`; - +ALTER TABLE `charlog` ADD COLUMN `char_id` INT(11) UNSIGNED NOT NULL DEFAULT '0' AFTER `account_id`; -- Upgrades for table `guild_storage` -ALTER TABLE `guild_storage` MODIFY `bound` tinyint(1) unsigned NOT NULL default '0'; - +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'; - +ALTER TABLE `inventory` MODIFY `bound` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'; -- Login table will be upgraded at a later point on this file -- so that we can save the bank vault. - -- Upgrades for table `mapreg` -ALTER TABLE `mapreg` MODIFY `varname` varchar(32) BINARY NOT NULL, +ALTER TABLE `mapreg` MODIFY `varname` VARCHAR(32) BINARY NOT NULL, DROP KEY `varname`, DROP KEY `index`, - ADD PRIMARY KEY (`varname`,`index`); - + ADD PRIMARY KEY (`varname`,`index`); -- Upgrades for table `sc_data` ALTER TABLE `pet` CHANGE `incuvate` `incubate` int(11) unsigned NOT NULL default '0'; @@ -57,14 +49,13 @@ ALTER TABLE `pet` CHANGE `incuvate` `incubate` int(11) unsigned NOT NULL default -- Upgrades for table `sc_data` ALTER TABLE `sc_data` ADD PRIMARY KEY (`account_id`,`char_id`,`type`); - -- -- 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', + `timestamp` INT(11) UNSIGNED NOT NULL, + `ignored` ENUM('Yes','No') NOT NULL DEFAULT 'No', PRIMARY KEY (`timestamp`) ) ENGINE=MyISAM; @@ -97,21 +88,19 @@ INSERT INTO `sql_updates` (`timestamp`) VALUES (1396893866); -- 2014-04-07--22-0 INSERT INTO `sql_updates` (`timestamp`) VALUES (1398477600); -- 2014-04-26--10-00.sql INSERT INTO `sql_updates` (`timestamp`) VALUES (1400256139); -- 2014-05-17--00-06.sql - -- Updates to table `storage` -ALTER TABLE `storage` MODIFY `bound` tinyint(1) unsigned NOT NULL default '0'; - +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', + `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; @@ -119,29 +108,25 @@ CREATE TABLE IF NOT EXISTS `account_data` ( -- 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 ; - -- Upgrades for table `login` ALTER TABLE `login` DROP COLUMN `vip_time`, DROP COLUMN `old_group`, DROP COLUMN `bank_vault`; - -- Drop table `bonus_script` since it's not used in Hercules DROP TABLE IF EXISTS `bonus_script`; - -- -- Table structure for table `npc_market_data` -- 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`) + `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; - -- Autotrade saving. Very special thanks to Dastgir Pojee! -- -- Vending Database Update @@ -163,7 +148,7 @@ ALTER TABLE `vending_items` MODIFY `price` INT(11) NOT NULL DEFAULT '0'; ALTER TABLE `vending_items` - ADD PRIMARY KEY( `char_id`, `itemkey`); + ADD PRIMARY KEY ( `char_id`, `itemkey`); RENAME TABLE `vending_items` TO `autotrade_data`; @@ -213,11 +198,11 @@ DROP TABLE IF EXISTS `buyingstores`, `buyingstore_items`; -- 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`), + `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; @@ -227,71 +212,66 @@ CREATE TABLE IF NOT EXISTS `acc_reg_num_db` ( -- 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`), + `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; - -- -- Table structure for table `char_reg_num_db` -- 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`), + `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; - -- -- Table structure for table `char_reg_str_db` -- 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`), + `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; - -- -- Table structure for table `global_acc_reg_num_db` -- 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`), + `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; - -- -- Table structure for table `global_acc_reg_str_db` -- 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`), + `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; - -- Saving the data 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 '%$'; @@ -302,3 +282,4 @@ INSERT INTO `global_acc_reg_str_db` (`account_id`, `key`, `index`, `value`) SELE -- Dropping now useless table DROP TABLE `global_reg_value`; + -- cgit v1.2.3-70-g09d2 From f5de504f681bc86b095d43c79466c759a942d8ed Mon Sep 17 00:00:00 2001 From: jaBote Date: Tue, 22 Jul 2014 22:00:58 +0200 Subject: Update rAthena-main-upgrade.sql Updating to adapt the database from current latest rAthena server. Couldn't test since I haven't got a test database right now, but looks good enough. Any issue should happen with it, please address me at Hercules forums rather than here. --- sql-files/upgrades/rAthena-main-upgrade.sql | 52 ++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 9 deletions(-) (limited to 'sql-files/upgrades/rAthena-main-upgrade.sql') diff --git a/sql-files/upgrades/rAthena-main-upgrade.sql b/sql-files/upgrades/rAthena-main-upgrade.sql index 37b961d54..f00386207 100644 --- a/sql-files/upgrades/rAthena-main-upgrade.sql +++ b/sql-files/upgrades/rAthena-main-upgrade.sql @@ -4,7 +4,7 @@ -- 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 --- Last revised: April 26, 2014 12:29 GMT +-- Last revised: July 22, 2014 21:45 GMT -- 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 @@ -15,35 +15,64 @@ TRUNCATE TABLE `sc_data`; -- Drop table `skillcooldown` since it's not used in Hercules DROP TABLE IF EXISTS `skillcooldown`; +-- Upgrades for table `auction` +ALTER TABLE `auction` MODIFY `nameid` INT(11) NOT NULL DEFAULT '0', + MODIFY `card0` SMALLINT(11) NOT NULL DEFAULT '0', + MODIFY `card1` SMALLINT(11) NOT NULL DEFAULT '0', + MODIFY `card2` SMALLINT(11) NOT NULL DEFAULT '0', + MODIFY `card3` SMALLINT(11) NOT NULL DEFAULT '0'; + -- Upgrades for table `cart_inventory` -ALTER TABLE `cart_inventory` MODIFY `bound` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `cart_inventory` MODIFY `nameid` INT(11) NOT NULL DEFAULT '0', + MODIFY `card0` SMALLINT(11) NOT NULL DEFAULT '0', + MODIFY `card1` SMALLINT(11) NOT NULL DEFAULT '0', + MODIFY `card2` SMALLINT(11) NOT NULL DEFAULT '0', + MODIFY `card3` SMALLINT(11) NOT NULL DEFAULT '0', + 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' AFTER `slotchange`, - ADD `font` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `char_opt`, - MODIFY `uniqueitem_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'; + MODIFY `font` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `char_opt`, + ADD `uniqueitem_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' AFTER `unban_time`; -- Upgrades for table `charlog` ALTER TABLE `charlog` ADD COLUMN `char_id` INT(11) UNSIGNED NOT NULL DEFAULT '0' AFTER `account_id`; -- Upgrades for table `guild_storage` -ALTER TABLE `guild_storage` MODIFY `bound` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `guild_storage` MODIFY `nameid` INT(11) NOT NULL DEFAULT '0', + MODIFY `card0` SMALLINT(11) NOT NULL DEFAULT '0', + MODIFY `card1` SMALLINT(11) NOT NULL DEFAULT '0', + MODIFY `card2` SMALLINT(11) NOT NULL DEFAULT '0', + MODIFY `card3` SMALLINT(11) NOT NULL DEFAULT '0', + 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'; +ALTER TABLE `inventory` MODIFY `nameid` INT(11) NOT NULL DEFAULT '0', + MODIFY `card0` SMALLINT(11) NOT NULL DEFAULT '0', + MODIFY `card1` SMALLINT(11) NOT NULL DEFAULT '0', + MODIFY `card2` SMALLINT(11) NOT NULL DEFAULT '0', + MODIFY `card3` SMALLINT(11) NOT NULL DEFAULT '0', + MODIFY `bound` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'; -- Login table will be upgraded at a later point on this file -- so that we can save the bank vault. +-- Upgrades for table `mail` +ALTER TABLE `mail` MODIFY `nameid` INT(11) NOT NULL DEFAULT '0', + MODIFY `card0` SMALLINT(11) NOT NULL DEFAULT '0', + MODIFY `card1` SMALLINT(11) NOT NULL DEFAULT '0', + MODIFY `card2` SMALLINT(11) NOT NULL DEFAULT '0', + MODIFY `card3` SMALLINT(11) NOT NULL DEFAULT '0'; + -- Upgrades for table `mapreg` ALTER TABLE `mapreg` MODIFY `varname` VARCHAR(32) BINARY NOT NULL, DROP KEY `varname`, DROP KEY `index`, ADD PRIMARY KEY (`varname`,`index`); --- Upgrades for table `sc_data` -ALTER TABLE `pet` CHANGE `incuvate` `incubate` int(11) unsigned NOT NULL default '0'; +-- Upgrades for table `pet` +ALTER TABLE `pet` MODIFY `egg_id` SMALLINT(11) UNSIGNED NOT NULL DEFAULT '0'; -- Upgrades for table `sc_data` @@ -89,7 +118,12 @@ INSERT INTO `sql_updates` (`timestamp`) VALUES (1398477600); -- 2014-04-26--10-0 INSERT INTO `sql_updates` (`timestamp`) VALUES (1400256139); -- 2014-05-17--00-06.sql -- Updates to table `storage` -ALTER TABLE `storage` MODIFY `bound` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'; +ALTER TABLE `storage` MODIFY `nameid` INT(11) NOT NULL DEFAULT '0', + MODIFY `card0` SMALLINT(11) NOT NULL DEFAULT '0', + MODIFY `card1` SMALLINT(11) NOT NULL DEFAULT '0', + MODIFY `card2` SMALLINT(11) NOT NULL DEFAULT '0', + MODIFY `card3` SMALLINT(11) NOT NULL DEFAULT '0', + MODIFY `bound` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'; -- -- Table structure for table `account_data` -- cgit v1.2.3-70-g09d2