summaryrefslogtreecommitdiff
path: root/sql-files
diff options
context:
space:
mode:
Diffstat (limited to 'sql-files')
-rw-r--r--sql-files/main.sql99
-rw-r--r--sql-files/upgrades/2014-01-04--16-47.sql61
-rw-r--r--sql-files/upgrades/index.txt1
3 files changed, 144 insertions, 17 deletions
diff --git a/sql-files/main.sql b/sql-files/main.sql
index 30882546e..398bdcfe4 100644
--- a/sql-files/main.sql
+++ b/sql-files/main.sql
@@ -189,20 +189,6 @@ CREATE TABLE IF NOT EXISTS `hotkey` (
) ENGINE=MyISAM;
--
--- Table structure for table `global_reg_value`
---
-
-CREATE TABLE IF NOT EXISTS `global_reg_value` (
- `char_id` int(11) unsigned NOT NULL default '0',
- `str` varchar(255) NOT NULL default '',
- `value` varchar(255) NOT NULL default '0',
- `type` tinyint(1) NOT NULL default '3',
- `account_id` int(11) unsigned NOT NULL default '0',
- PRIMARY KEY (`char_id`,`str`,`account_id`),
- KEY `account_id` (`account_id`)
-) ENGINE=MyISAM;
-
---
-- Table structure for table `guild`
--
@@ -462,11 +448,10 @@ INSERT INTO `login` (`account_id`, `userid`, `user_pass`, `sex`, `email`) VALUES
--
CREATE TABLE IF NOT EXISTS `mapreg` (
- `varname` varchar(32) NOT NULL,
+ `varname` varchar(32) BINARY NOT NULL,
`index` int(11) unsigned NOT NULL default '0',
`value` varchar(255) NOT NULL,
- KEY `varname` (`varname`),
- KEY `index` (`index`)
+ PRIMARY KEY (`varname`,`index`)
) ENGINE=MyISAM;
--
@@ -672,6 +657,7 @@ 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 (1387844126);
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1388854043);
INSERT INTO `sql_updates` (`timestamp`) VALUES (1389028967);
--
@@ -745,6 +731,85 @@ CREATE TABLE IF NOT EXISTS `npc_market_data` (
) ENGINE=MyISAM;
--
+-- 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;
+
+--
-- Table structure for table `autotrade_merchants`
--
diff --git a/sql-files/upgrades/2014-01-04--16-47.sql b/sql-files/upgrades/2014-01-04--16-47.sql
new file mode 100644
index 000000000..a60ec1d24
--- /dev/null
+++ b/sql-files/upgrades/2014-01-04--16-47.sql
@@ -0,0 +1,61 @@
+#1388854043
+ALTER TABLE `mapreg` ADD PRIMARY KEY (`varname`, `index`);
+ALTER TABLE `mapreg` DROP INDEX `varname`;
+ALTER TABLE `mapreg` DROP INDEX `index`;
+ALTER TABLE `mapreg` MODIFY `varname` varchar(32) BINARY NOT NULL;
+CREATE TABLE IF NOT EXISTS `acc_reg_num_db` (
+ `account_id` int(11) unsigned NOT NULL default '0',
+ `key` varchar(32) BINARY NOT NULL default '',
+ `index` int(11) unsigned NOT NULL default '0',
+ `value` int(11) NOT NULL default '0',
+ PRIMARY KEY (`account_id`,`key`,`index`),
+ KEY `account_id` (`account_id`)
+) ENGINE=MyISAM;
+CREATE TABLE IF NOT EXISTS `acc_reg_str_db` (
+ `account_id` int(11) unsigned NOT NULL default '0',
+ `key` varchar(32) BINARY NOT NULL default '',
+ `index` int(11) unsigned NOT NULL default '0',
+ `value` varchar(254) NOT NULL default '0',
+ PRIMARY KEY (`account_id`,`key`,`index`),
+ KEY `account_id` (`account_id`)
+) ENGINE=MyISAM;
+CREATE TABLE IF NOT EXISTS `char_reg_num_db` (
+ `char_id` int(11) unsigned NOT NULL default '0',
+ `key` varchar(32) BINARY NOT NULL default '',
+ `index` int(11) unsigned NOT NULL default '0',
+ `value` int(11) NOT NULL default '0',
+ PRIMARY KEY (`char_id`,`key`,`index`),
+ KEY `char_id` (`char_id`)
+) ENGINE=MyISAM;
+CREATE TABLE IF NOT EXISTS `char_reg_str_db` (
+ `char_id` int(11) unsigned NOT NULL default '0',
+ `key` varchar(32) BINARY NOT NULL default '',
+ `index` int(11) unsigned NOT NULL default '0',
+ `value` varchar(254) NOT NULL default '0',
+ PRIMARY KEY (`char_id`,`key`,`index`),
+ KEY `char_id` (`char_id`)
+) ENGINE=MyISAM;
+CREATE TABLE IF NOT EXISTS `global_acc_reg_num_db` (
+ `account_id` int(11) unsigned NOT NULL default '0',
+ `key` varchar(32) BINARY NOT NULL default '',
+ `index` int(11) unsigned NOT NULL default '0',
+ `value` int(11) NOT NULL default '0',
+ PRIMARY KEY (`account_id`,`key`,`index`),
+ KEY `account_id` (`account_id`)
+) ENGINE=MyISAM;
+CREATE TABLE IF NOT EXISTS `global_acc_reg_str_db` (
+ `account_id` int(11) unsigned NOT NULL default '0',
+ `key` varchar(32) BINARY NOT NULL default '',
+ `index` int(11) unsigned NOT NULL default '0',
+ `value` varchar(254) NOT NULL default '0',
+ PRIMARY KEY (`account_id`,`key`,`index`),
+ KEY `account_id` (`account_id`)
+) ENGINE=MyISAM;
+INSERT INTO `acc_reg_num_db` (`account_id`, `key`, `index`, `value`) SELECT `account_id`, `str`, 0, `value` FROM `global_reg_value` WHERE `type` = 2 AND `str` NOT LIKE '%$';
+INSERT INTO `acc_reg_str_db` (`account_id`, `key`, `index`, `value`) SELECT `account_id`, `str`, 0, `value` FROM `global_reg_value` WHERE `type` = 2 AND `str` LIKE '%$';
+INSERT INTO `char_reg_num_db` (`char_id`, `key`, `index`, `value`) SELECT `char_id`, `str`, 0, `value` FROM `global_reg_value` WHERE `type` = 3 AND `str` NOT LIKE '%$';
+INSERT INTO `char_reg_str_db` (`char_id`, `key`, `index`, `value`) SELECT `char_id`, `str`, 0, `value` FROM `global_reg_value` WHERE `type` = 3 AND `str` LIKE '%$';
+INSERT INTO `global_acc_reg_num_db` (`account_id`, `key`, `index`, `value`) SELECT `account_id`, `str`, 0, `value` FROM `global_reg_value` WHERE `type` = 1 AND `str` NOT LIKE '%$';
+INSERT INTO `global_acc_reg_str_db` (`account_id`, `key`, `index`, `value`) SELECT `account_id`, `str`, 0, `value` FROM `global_reg_value` WHERE `type` = 1 AND `str` LIKE '%$';
+#DROP TABLE `global_reg_value`;
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1388854043); \ No newline at end of file
diff --git a/sql-files/upgrades/index.txt b/sql-files/upgrades/index.txt
index ce75fa882..bf404d919 100644
--- a/sql-files/upgrades/index.txt
+++ b/sql-files/upgrades/index.txt
@@ -16,4 +16,5 @@
2013-11-16--07-49.sql
2013-11-18--08-23.sql
2013-12-24--00-15.sql
+2014-01-04--16-47.sql
2014-01-06--17-22.sql \ No newline at end of file