Add mising fields into spells table, fix some mysql errors

This commit is contained in:
tobi132
2019-09-20 19:13:15 +02:00
parent d8a70a3da6
commit 5a97e53e21
3 changed files with 22 additions and 3 deletions

17
system/migrations/26.php Normal file
View File

@@ -0,0 +1,17 @@
<?php
if($db->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`;');
}