diff --git a/common.php b/common.php index e84395a1..2411b518 100644 --- a/common.php +++ b/common.php @@ -27,7 +27,7 @@ session_start(); define('MYAAC', true); define('MYAAC_VERSION', '0.8-dev'); -define('DATABASE_VERSION', 25); +define('DATABASE_VERSION', 26); define('TABLE_PREFIX', 'myaac_'); define('START_TIME', microtime(true)); define('MYAAC_OS', stripos(PHP_OS, 'WIN') === 0 ? 'WINDOWS' : (strtoupper(PHP_OS) === 'DARWIN' ? 'MAC' : 'LINUX')); diff --git a/install/includes/schema.sql b/install/includes/schema.sql index ae105edd..cb4d1bd0 100644 --- a/install/includes/schema.sql +++ b/install/includes/schema.sql @@ -318,16 +318,18 @@ INSERT INTO `myaac_gallery` (`id`, `ordering`, `comment`, `image`, `thumb`, `aut CREATE TABLE `myaac_spells` ( `id` INT(11) NOT NULL AUTO_INCREMENT, - `spell` VARCHAR(255) NOT NULL, + `spell` VARCHAR(255) NOT NULL DEFAULT '', `name` VARCHAR(255) NOT NULL, - `words` VARCHAR(255) NOT NULL, + `words` VARCHAR(255) NOT NULL DEFAULT '', `category` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '1 - attack, 2 - healing, 3 - summon, 4 - supply, 5 - support', `type` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '1 - instant, 2 - conjure, 3 - rune', `level` INT(11) NOT NULL DEFAULT 0, `maglevel` INT(11) NOT NULL DEFAULT 0, `mana` INT(11) NOT NULL DEFAULT 0, `soul` TINYINT(3) NOT NULL DEFAULT 0, + `conjure_id` INT(11) NOT NULL DEFAULT 0, `conjure_count` TINYINT(3) NOT NULL DEFAULT 0, + `reagent` INT(11) NOT NULL DEFAULT 0, `item_id` INT(11) NOT NULL DEFAULT 0, `premium` TINYINT(1) NOT NULL DEFAULT 0, `vocations` VARCHAR(100) NOT NULL DEFAULT '', diff --git a/system/migrations/26.php b/system/migrations/26.php new file mode 100644 index 00000000..9804b774 --- /dev/null +++ b/system/migrations/26.php @@ -0,0 +1,17 @@ +hasColumn(TABLE_PREFIX . 'spells', 'spell')) { + $db->exec('ALTER TABLE `' . TABLE_PREFIX . "spells` MODIFY `spell` VARCHAR(255) NOT NULL DEFAULT '';"); +} + +if($db->hasColumn(TABLE_PREFIX . 'spells', 'words')) { + $db->exec('ALTER TABLE `' . TABLE_PREFIX . "spells` MODIFY `words` VARCHAR(255) NOT NULL DEFAULT '';"); +} + +if(!$db->hasColumn(TABLE_PREFIX . 'spells', 'conjure_id')) { + $db->exec('ALTER TABLE `' . TABLE_PREFIX . 'spells` ADD `conjure_id` INT(11) NOT NULL DEFAULT 0 AFTER `soul`;'); +} + +if(!$db->hasColumn(TABLE_PREFIX . 'spells', 'reagent')) { + $db->exec('ALTER TABLE `' . TABLE_PREFIX . 'spells` ADD `reagent` INT(11) NOT NULL DEFAULT 0 AFTER `conjure_count`;'); +}