From 129d5653e6ae8a4e80d6561b6176fde36c97c992 Mon Sep 17 00:00:00 2001 From: slawkens Date: Tue, 16 Feb 2021 01:12:45 +0100 Subject: [PATCH] Apply changes from develop branch --- install/includes/schema.sql | 18 +++++++++++++++++- system/migrations/31.php | 4 ++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/install/includes/schema.sql b/install/includes/schema.sql index da3827c4..7ccf2e7f 100644 --- a/install/includes/schema.sql +++ b/install/includes/schema.sql @@ -1,3 +1,5 @@ +SET @myaac_database_version = 32; + CREATE TABLE `myaac_account_actions` ( `account_id` INT(11) NOT NULL, @@ -57,7 +59,7 @@ CREATE TABLE `myaac_config` UNIQUE (`name`) ) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8; -INSERT INTO `myaac_config` (`name`, `value`) VALUES ('database_version', 30); +INSERT INTO `myaac_config` (`name`, `value`) VALUES ('database_version', @myaac_database_version); CREATE TABLE `myaac_faq` ( @@ -205,10 +207,24 @@ CREATE TABLE `myaac_monsters` ( `use_haste` tinyint(1) NOT NULL, `voices` text NOT NULL, `immunities` varchar(255) NOT NULL, + `elements` TEXT NOT NULL, `summonable` tinyint(1) NOT NULL, `convinceable` tinyint(1) NOT NULL, + `pushable` TINYINT(1) NOT NULL DEFAULT '0', + `canpushitems` TINYINT(1) NOT NULL DEFAULT '0', + `canwalkonenergy` TINYINT(1) NOT NULL DEFAULT '0', + `canwalkonpoison` TINYINT(1) NOT NULL DEFAULT '0', + `canwalkonfire` TINYINT(1) NOT NULL DEFAULT '0', + `runonhealth` TINYINT(1) NOT NULL DEFAULT '0', + `hostile` TINYINT(1) NOT NULL DEFAULT '0', + `attackable` TINYINT(1) NOT NULL DEFAULT '0', + `rewardboss` TINYINT(1) NOT NULL DEFAULT '0', + `defense` INT(11) NOT NULL DEFAULT '0', + `armor` INT(11) NOT NULL DEFAULT '0', + `canpushcreatures` TINYINT(1) NOT NULL DEFAULT '0', `race` varchar(255) NOT NULL, `loot` text NOT NULL, + `summons` TEXT NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8; diff --git a/system/migrations/31.php b/system/migrations/31.php index f63fc394..744ba21f 100644 --- a/system/migrations/31.php +++ b/system/migrations/31.php @@ -1,7 +1,7 @@ hasColumn(TABLE_PREFIX . 'monsters', 'elements')) { - $db->exec("ALTER TABLE `" . TABLE_PREFIX . "monsters` ADD `elements` TEXT AFTER `immunities`;"); + $db->exec("ALTER TABLE `" . TABLE_PREFIX . "monsters` ADD `elements` TEXT NOT NULL AFTER `immunities`;"); $db->exec("ALTER TABLE `" . TABLE_PREFIX . "monsters` ADD `pushable` TINYINT(1) NOT NULL DEFAULT '0' AFTER `convinceable`;"); $db->exec("ALTER TABLE `" . TABLE_PREFIX . "monsters` ADD `canpushitems` TINYINT(1) NOT NULL DEFAULT '0' AFTER `pushable`;"); $db->exec("ALTER TABLE `" . TABLE_PREFIX . "monsters` ADD `canpushcreatures` TINYINT(1) NOT NULL DEFAULT '0' AFTER `canpushitems`;"); @@ -14,5 +14,5 @@ if(!$db->hasColumn(TABLE_PREFIX . 'monsters', 'elements')) { $db->exec("ALTER TABLE `" . TABLE_PREFIX . "monsters` ADD `rewardboss` TINYINT(1) NOT NULL DEFAULT '0' AFTER `attackable`;"); $db->exec("ALTER TABLE `" . TABLE_PREFIX . "monsters` ADD `defense` INT(11) NOT NULL DEFAULT '0' AFTER `rewardboss`;"); $db->exec("ALTER TABLE `" . TABLE_PREFIX . "monsters` ADD `armor` INT(11) NOT NULL DEFAULT '0' AFTER `defense`;"); - $db->exec("ALTER TABLE `" . TABLE_PREFIX . "monsters` ADD `summons` TEXT AFTER `loot`;"); + $db->exec("ALTER TABLE `" . TABLE_PREFIX . "monsters` ADD `summons` TEXT NOT NULL AFTER `loot`;"); }