Update SQL

This commit is contained in:
icomrade
2016-08-03 22:14:42 -04:00
parent b8c3aec4e0
commit b10e73b1b8
2 changed files with 43 additions and 2 deletions

View File

@@ -10,9 +10,38 @@ ALTER TABLE Object_DATA MODIFY COLUMN CharacterID bigint(20);
ALTER TABLE Object_DATA MODIFY COLUMN Hitpoints varchar(1024);
-- ----------------------------
-- Update player_data to support group system with ~100 players per group
-- Update Object_DATA to support single currency
-- ----------------------------
ALTER TABLE player_data ADD playerGroup varchar(2048) NOT NULL DEFAULT '[]';
ALTER TABLE `Object_DATA` ADD `StorageCoins` bigint(20) NOT NULL DEFAULT '0';
-- ----------------------------
-- Update character_data to support single currency
-- ----------------------------
SET @s = (SELECT IF(
(SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'character_data'
AND table_schema = DATABASE()
AND COLUMN_NAME = 'CashMoney'
) > 0,
'SELECT 1',
"ALTER TABLE `character_data` ADD `CashMoney` bigint(20) NOT NULL DEFAULT '0'"
));
PREPARE stmt FROM @s;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
ALTER TABLE `character_data` CHANGE `CashMoney` `Coins` bigint(20) NOT NULL DEFAULT '0';
-- ----------------------------
-- Update player_data to support group system with ~100 players per group
-- Also add single currency support
-- ----------------------------
ALTER TABLE Player_DATA ADD playerGroup varchar(2048) NOT NULL DEFAULT '[]';
ALTER TABLE Player_DATA ADD PlayerCoins bigint(20) NOT NULL DEFAULT '0';
ALTER TABLE Player_DATA ADD BankCoins bigint(20) NOT NULL DEFAULT '0';
-- ----------------------------
-- Fix typo from 1.0.5.1 updates causing Merlin and CH53 to show as magazines instead of vehicles
@@ -471,6 +500,14 @@ UPDATE character_data SET Inventory = REPLACE(Inventory, 'Winchester1866', 'Winc
UPDATE object_data SET Inventory = REPLACE(Inventory, 'Winchester1866', 'Winchester1866_DZ') WHERE INSTR(Inventory, 'Winchester1866') > 0;
-- ----------------------------
-- Uncomment the below queries to update new columns if you previously used a custom single currency hive with a banking_Data table
-- ----------------------------
-- UPDATE player_data t1, banking_data t2
-- SET t1.`PlayerCoins` = t2.bankMoney,
-- t1.`BankCoins` = t2.BankSaldo
-- WHERE t1.PlayerUID = t2.PlayerUID --
-- ----------------------------
-- Run to replace legacy bloodbag with universal type if using dayz_classicBloodBagSystem = false;
-- ----------------------------

View File

@@ -32,6 +32,7 @@ CREATE TABLE IF NOT EXISTS `Character_DATA` (
`KillsB` int(11) unsigned NOT NULL DEFAULT '0',
`Humanity` int(11) NOT NULL DEFAULT '2500',
`Infected` tinyint(3) DEFAULT '0',
`Coins` bigint(20) NOT NULL DEFAULT '0',
PRIMARY KEY (`CharacterID`),
KEY `PlayerUID` (`PlayerUID`) USING BTREE,
KEY `Alive` (`Alive`) USING BTREE
@@ -57,6 +58,7 @@ CREATE TABLE IF NOT EXISTS `Object_DATA` (
`Hitpoints` varchar(1024) NOT NULL DEFAULT '[]',
`Fuel` double(13,5) NOT NULL DEFAULT '1.00000',
`Damage` double(13,5) NOT NULL DEFAULT '0.00000',
`StorageCoins` bigint(20) NOT NULL DEFAULT '0',
PRIMARY KEY (`ObjectID`),
KEY `ObjectUID` (`ObjectUID`) USING BTREE,
KEY `Instance` (`Instance`) USING BTREE
@@ -76,6 +78,8 @@ CREATE TABLE IF NOT EXISTS `Player_DATA` (
`PlayerMorality` int(11) NOT NULL DEFAULT '0',
`PlayerSex` tinyint(3) unsigned NOT NULL DEFAULT '0',
`playerGroup` varchar(2048) NOT NULL DEFAULT '[]',
`PlayerCoins` bigint(20) NOT NULL DEFAULT '0',
`BankCoins` bigint(20) NOT NULL DEFAULT '0',
PRIMARY KEY (`PlayerUID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;