summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShido <the.keikun@gmail.com>2014-05-30 10:15:22 +0800
committerShido <the.keikun@gmail.com>2014-07-10 23:53:22 +0800
commitef8700dfa9e21acf1963fd8a139e79bf5dec0dd9 (patch)
tree4275b120e38e50849437fc9f77f12f71993348fd
parent3213a3b913ce11c6466f94388e3853232673c45b (diff)
downloadhercules-ef8700dfa9e21acf1963fd8a139e79bf5dec0dd9.tar.gz
hercules-ef8700dfa9e21acf1963fd8a139e79bf5dec0dd9.tar.bz2
hercules-ef8700dfa9e21acf1963fd8a139e79bf5dec0dd9.tar.xz
hercules-ef8700dfa9e21acf1963fd8a139e79bf5dec0dd9.zip
Updated sql-upgrade files.
-rw-r--r--sql-files/upgrades/2013-02-14--16-15.sql4
-rw-r--r--sql-files/upgrades/2013-02-15--18-06.sql2
-rw-r--r--sql-files/upgrades/2013-03-05--01-05.sql2
-rw-r--r--sql-files/upgrades/2013-03-09--01-56.sql4
-rw-r--r--sql-files/upgrades/2013-04-16--01-24.sql2
-rw-r--r--sql-files/upgrades/2013-04-16--02-15.sql4
-rw-r--r--sql-files/upgrades/2013-10-09--21-38.sql2
-rw-r--r--sql-files/upgrades/2013-10-10--16-36.sql6
-rw-r--r--sql-files/upgrades/2013-10-27--16-47.sql8
-rw-r--r--sql-files/upgrades/2013-10-30--19-53.sql6
-rw-r--r--sql-files/upgrades/2013-10-30--21-12.sql2
-rw-r--r--sql-files/upgrades/2013-10-31--07-49.sql4
-rw-r--r--sql-files/upgrades/2013-11-09--00-03.sql6
-rw-r--r--sql-files/upgrades/2013-11-15--00-06.sql80
-rw-r--r--sql-files/upgrades/2013-11-16--07-49.sql2
-rw-r--r--sql-files/upgrades/2013-11-18--08-23.sql4
-rw-r--r--sql-files/upgrades/2013-12-24--00-15.sql8
-rw-r--r--sql-files/upgrades/2014-01-04--16-47.sql64
-rw-r--r--sql-files/upgrades/2014-01-06--17-22.sql20
-rw-r--r--sql-files/upgrades/2014-02-19--17-57.sql2
-rw-r--r--sql-files/upgrades/2014-03-25--23-57.sql2
-rw-r--r--sql-files/upgrades/2014-04-07--22-04.sql2
-rw-r--r--sql-files/upgrades/2014-04-26--10-00.sql2
-rw-r--r--sql-files/upgrades/eathena-upgrade.sql104
-rw-r--r--sql-files/upgrades/rAthena-main-upgrade.sql125
25 files changed, 242 insertions, 225 deletions
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`;
+