From 1bdfe3079c4ed829bc5adb9cb6d325479191abc3 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Thu, 23 Jul 2020 21:07:49 -0300 Subject: SQL update - still compatible --- sql-files/logs.sql | 2 +- sql-files/main.sql | 76 +++++++++++++++++++ sql-files/upgrades/2020-08-01--00-00.sql | 121 +++++++++++++++++++++++++++++++ sql-files/upgrades/index.txt | 1 + 4 files changed, 199 insertions(+), 1 deletion(-) create mode 100644 sql-files/upgrades/2020-08-01--00-00.sql diff --git a/sql-files/logs.sql b/sql-files/logs.sql index ea7d5b927..45aa83c55 100644 --- a/sql-files/logs.sql +++ b/sql-files/logs.sql @@ -144,7 +144,7 @@ CREATE TABLE IF NOT EXISTS `picklog` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `time` DATETIME NULL, `char_id` INT(11) NOT NULL DEFAULT '0', - `type` ENUM('M','P','L','T','V','S','N','C','A','R','G','E','B','O','I','X','D','U','K','Y','Z','W','Q','J','H','@','0','1','2') NOT NULL DEFAULT 'P', + `type` ENUM('M','P','L','T','V','S','N','C','A','R','G','E','B','O','I','X','D','U','K','Y','Z','W','Q','J','H','@','0','1','2','3') NOT NULL DEFAULT 'P', `nameid` INT(11) NOT NULL DEFAULT '0', `amount` INT(11) NOT NULL DEFAULT '1', `refine` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0', diff --git a/sql-files/main.sql b/sql-files/main.sql index a353e6a1c..f48da3c96 100644 --- a/sql-files/main.sql +++ b/sql-files/main.sql @@ -691,6 +691,28 @@ CREATE TABLE IF NOT EXISTS `mapreg` ( PRIMARY KEY (`varname`,`index`) ) ENGINE=MyISAM; +-- +-- Table structure for table `map_reg_num_db` +-- + +CREATE TABLE IF NOT EXISTS `map_reg_num_db` ( + `key` VARCHAR(32) BINARY NOT NULL DEFAULT '', + `index` INT UNSIGNED NOT NULL DEFAULT '0', + `value` INT NOT NULL DEFAULT '0', + PRIMARY KEY (`key`, `index`) +) ENGINE=MyISAM; + +-- +-- Table structure for table `map_reg_str_db` +-- + +CREATE TABLE IF NOT EXISTS `map_reg_str_db` ( + `key` VARCHAR(32) BINARY NOT NULL DEFAULT '', + `index` INT UNSIGNED NOT NULL DEFAULT '0', + `value` VARCHAR(255) NOT NULL DEFAULT '0', + PRIMARY KEY (`key`, `index`) +) ENGINE=MyISAM; + -- -- Table structure for table `npc_market_data` -- @@ -711,6 +733,7 @@ CREATE TABLE IF NOT EXISTS `sc_data` ( `char_id` INT(11) UNSIGNED NOT NULL, `type` SMALLINT(11) UNSIGNED NOT NULL, `tick` INT(11) NOT NULL, + `total_tick` INT NOT NULL, `val1` INT(11) NOT NULL DEFAULT '0', `val2` INT(11) NOT NULL DEFAULT '0', `val3` INT(11) NOT NULL DEFAULT '0', @@ -956,6 +979,16 @@ INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1546059075); -- 2018-12-2 INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1554760320); -- 2019-04-08--21-52.sql INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1556147483); -- 2019-04-25--02-12.sql INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1557414445); -- 2019-05-09--18-07.sql +INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1565293394); -- 2019-08-08--19-43.sql +INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1570309293); -- 2019-10-05--19-01.sql +INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1570870260); -- 2019-10-21--14-21.sql +INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1574463539); -- 2019-11-22--23-58.sql +INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1579817630); -- 2020-01-24--01-09.sql +INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1584838560); -- 2020-03-22--01-56.sql +INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1584842940); -- 2020-03-22--03-09.sql +INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1588301040); -- 2020-05-01--04-44.sql +INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1589145060); -- 2020-05-10--23-11.sql +INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1596240000); -- 2020-08-01--00-00.sql -- -- Table structure for table `storage` @@ -1054,6 +1087,49 @@ CREATE TABLE IF NOT EXISTS `npc_barter_data` ( PRIMARY KEY (`name`, `itemid`, `priceId`, `priceAmount`) ) ENGINE=MyISAM; +CREATE TABLE IF NOT EXISTS `npc_expanded_barter_data` ( + `name` VARCHAR(24) NOT NULL DEFAULT '', + `itemId` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `amount` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `zeny` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyId1` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyAmount1` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyRefine1` INT(11) NOT NULL DEFAULT '0', + `currencyId2` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyAmount2` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyRefine2` INT(11) NOT NULL DEFAULT '0', + `currencyId3` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyAmount3` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyRefine3` INT(11) NOT NULL DEFAULT '0', + `currencyId4` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyAmount4` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyRefine4` INT(11) NOT NULL DEFAULT '0', + `currencyId5` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyAmount5` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyRefine5` INT(11) NOT NULL DEFAULT '0', + `currencyId6` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyAmount6` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyRefine6` INT(11) NOT NULL DEFAULT '0', + `currencyId7` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyAmount7` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyRefine7` INT(11) NOT NULL DEFAULT '0', + `currencyId8` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyAmount8` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyRefine8` INT(11) NOT NULL DEFAULT '0', + `currencyId9` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyAmount9` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyRefine9` INT(11) NOT NULL DEFAULT '0', + `currencyId10` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyAmount10` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyRefine10` INT(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`name`, `itemid`, `zeny`, + `currencyId1`, `currencyAmount1`, `currencyRefine1`, + `currencyId2`, `currencyAmount2`, `currencyRefine2`, + `currencyId3`, `currencyAmount3`, `currencyRefine3`, + `currencyId4`, `currencyAmount4`, `currencyRefine4` +) +) ENGINE=MyISAM; + -- Bound items cannot go to ManaMarket anyway -- PS. id autofilled, accountid/price/expire by MM -- options by index, all others by getinventorylist() diff --git a/sql-files/upgrades/2020-08-01--00-00.sql b/sql-files/upgrades/2020-08-01--00-00.sql new file mode 100644 index 000000000..1721c6357 --- /dev/null +++ b/sql-files/upgrades/2020-08-01--00-00.sql @@ -0,0 +1,121 @@ +#1596240000 + +-- This file is part of Hercules. +-- http://herc.ws - http://github.com/HerculesWS/Hercules +-- +-- Copyright (C) 2019-2020 Hercules Dev Team +-- +-- Hercules is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . + +-- MOUBOOTAUR LEGENDS +-- Merge a lot of updates and drop stuff I don't need. + +-- --------------------------------------------------------------------------- +-- Update: 2019-10-05--19-01 +-- --------------------------------------------------------------------------- +-- Adds new total_tick column +ALTER TABLE `sc_data` ADD COLUMN `total_tick` INT(11) NOT NULL AFTER `tick`; + +-- Copy current tick to total_tick so players doesn't lose their current +-- status_changes, although those will still appear wrong until they end +UPDATE `sc_data` SET `total_tick` = `tick`; + +INSERT INTO `sql_updates` (`timestamp`) VALUES (1570309293); + +-- --------------------------------------------------------------------------- +-- Update: 2019-10-12--14-21 +-- --------------------------------------------------------------------------- +ALTER TABLE `picklog` MODIFY `type` enum('M','P','L','T','V','S','N','C','A','R','G','E','B','O','I','X','D','U','K','Y','Z','W','Q','J','H','@','0','1','2', '3') NOT NULL DEFAULT 'P'; +INSERT INTO `sql_updates` (`timestamp`) VALUES (1570870260); + +-- --------------------------------------------------------------------------- +-- Update: 2020-01-24--01-09 +-- --------------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `npc_expanded_barter_data` ( + `name` VARCHAR(24) NOT NULL DEFAULT '', + `itemId` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `amount` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `zeny` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyId1` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyAmount1` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyRefine1` INT(11) NOT NULL DEFAULT '0', + `currencyId2` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyAmount2` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyRefine2` INT(11) NOT NULL DEFAULT '0', + `currencyId3` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyAmount3` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyRefine3` INT(11) NOT NULL DEFAULT '0', + `currencyId4` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyAmount4` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyRefine4` INT(11) NOT NULL DEFAULT '0', + `currencyId5` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyAmount5` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyRefine5` INT(11) NOT NULL DEFAULT '0', + `currencyId6` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyAmount6` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyRefine6` INT(11) NOT NULL DEFAULT '0', + `currencyId7` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyAmount7` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyRefine7` INT(11) NOT NULL DEFAULT '0', + `currencyId8` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyAmount8` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyRefine8` INT(11) NOT NULL DEFAULT '0', + `currencyId9` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyAmount9` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyRefine9` INT(11) NOT NULL DEFAULT '0', + `currencyId10` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyAmount10` INT(11) UNSIGNED NOT NULL DEFAULT '0', + `currencyRefine10` INT(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`name`, `itemid`, `zeny`, + `currencyId1`, `currencyAmount1`, `currencyRefine1`, + `currencyId2`, `currencyAmount2`, `currencyRefine2`, + `currencyId3`, `currencyAmount3`, `currencyRefine3`, + `currencyId4`, `currencyAmount4`, `currencyRefine4` +) +) ENGINE=MyISAM; +INSERT INTO `sql_updates` (`timestamp`) VALUES (1579817630); + +-- --------------------------------------------------------------------------- +-- Update: 2020-05-10--23-11 +-- --------------------------------------------------------------------------- +-- Add separate tables for global integer and string variables. +CREATE TABLE IF NOT EXISTS `map_reg_num_db` ( + `key` VARCHAR(32) BINARY NOT NULL DEFAULT '', + `index` INT UNSIGNED NOT NULL DEFAULT '0', + `value` INT NOT NULL DEFAULT '0', + PRIMARY KEY (`key`, `index`) +) ENGINE=MyISAM; +CREATE TABLE IF NOT EXISTS `map_reg_str_db` ( + `key` VARCHAR(32) BINARY NOT NULL DEFAULT '', + `index` INT UNSIGNED NOT NULL DEFAULT '0', + `value` VARCHAR(255) NOT NULL DEFAULT '0', + PRIMARY KEY (`key`, `index`) +) ENGINE=MyISAM; + +-- Copy data from mapreg table to new map_reg_*_db tables. +INSERT INTO `map_reg_num_db` (`key`, `index`, `value`) SELECT `varname`, `index`, CAST(`value` AS SIGNED) FROM `mapreg` WHERE NOT RIGHT(`varname`, 1)='$'; +INSERT INTO `map_reg_str_db` (`key`, `index`, `value`) SELECT `varname`, `index`, `value` FROM `mapreg` WHERE RIGHT(`varname`, 1)='$'; + +-- Remove mapreg table. I don't want that. +-- DROP TABLE IF EXISTS `mapreg`; + +-- Add update timestamp. +INSERT INTO `sql_updates` (`timestamp`) VALUES (1589145060); + + +-- --------------------------------------------------------------------------- +-- Index +-- --------------------------------------------------------------------------- +INSERT INTO `sql_updates` (`timestamp`) VALUES (1596240000); + diff --git a/sql-files/upgrades/index.txt b/sql-files/upgrades/index.txt index 915d3565d..eaf2e74c7 100644 --- a/sql-files/upgrades/index.txt +++ b/sql-files/upgrades/index.txt @@ -54,3 +54,4 @@ 2019-04-08--21-52.sql 2019-04-25--02-12.sql 2019-05-09--18-07.sql +2020-08-01--00-00.sql -- cgit v1.2.3-60-g2f50