diff options
author | Haruna <haru@dotalux.com> | 2014-07-11 08:41:12 +0200 |
---|---|---|
committer | Haruna <haru@dotalux.com> | 2014-07-11 08:41:12 +0200 |
commit | 3f3f2e7ec09087b57148a0fb229de26293c5a462 (patch) | |
tree | 704907b1dc2294c554939e495a7317fc3aa1ef8f /sql-files/upgrades/rAthena-main-upgrade.sql | |
parent | cc4c87c6e9bb0a7af9e380400a95eb00c3905918 (diff) | |
parent | ef8700dfa9e21acf1963fd8a139e79bf5dec0dd9 (diff) | |
download | hercules-3f3f2e7ec09087b57148a0fb229de26293c5a462.tar.gz hercules-3f3f2e7ec09087b57148a0fb229de26293c5a462.tar.bz2 hercules-3f3f2e7ec09087b57148a0fb229de26293c5a462.tar.xz hercules-3f3f2e7ec09087b57148a0fb229de26293c5a462.zip |
Merge pull request #286 from MrKeiKun/fix/organize_sql_files
Fix/organize sql files
Diffstat (limited to 'sql-files/upgrades/rAthena-main-upgrade.sql')
-rw-r--r-- | sql-files/upgrades/rAthena-main-upgrade.sql | 125 |
1 files changed, 53 insertions, 72 deletions
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`; + |