rathena/sql-files/upgrades/upgrade_20150610.sql
aleos89 0696125b82 Script Engine Upgrade
* Upgraded the script engine variables to no longer be limited.
* Increased array limit from 127 to 2 billion.
* Improvement in overall speed and storage size.
* All variable types now support arrays.
- Merge from HerculesWS/Hercules@82b583b. Thanks to those who worked on it.
2015-06-11 10:44:13 -04:00

67 lines
3.2 KiB
SQL

ALTER TABLE `mapreg` ADD PRIMARY KEY (`varname`, `index`);
ALTER TABLE `mapreg` DROP INDEX `varname`;
ALTER TABLE `mapreg` DROP INDEX `index`;
ALTER TABLE `mapreg` MODIFY `varname` varchar(32) binary NOT NULL;
CREATE TABLE IF NOT EXISTS `acc_reg_num` (
`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` (
`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` (
`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` (
`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` (
`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` (
`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` (`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` (`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` (`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` (`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` (`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` (`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`;