diff --git a/system/migrations/12.php b/system/migrations/12.php index 75cd5690..00d6d6f0 100644 --- a/system/migrations/12.php +++ b/system/migrations/12.php @@ -38,7 +38,7 @@ $up = function () use ($db) { $v = (int)$v; } - Spell::where('id', $spell->id)->update('vocations', json_encode($tmp)); + Spell::where('id', $spell->id)->update(['vocations' => json_encode($tmp)]); } }; @@ -49,8 +49,8 @@ $down = function () use ($db) { } // change unique index from spell to name - $db->query("ALTER TABLE `" . TABLE_PREFIX . "spells` ADD INDEX `spell`;"); - $db->query("ALTER TABLE `" . TABLE_PREFIX . "spells` DROP UNIQUE INDEX (`name`);"); + $db->query("ALTER TABLE `" . TABLE_PREFIX . "spells` DROP INDEX `name`;"); + $db->query("ALTER TABLE `" . TABLE_PREFIX . "spells` ADD INDEX (`spell`);"); $db->dropTable(TABLE_PREFIX . 'items'); $db->dropTable(TABLE_PREFIX . 'weapons'); @@ -60,6 +60,6 @@ $down = function () use ($db) { foreach ($spells as $spell) { $vocations = empty($spell->vocations) ? [] : json_decode($spell->vocations); - Spell::where('id', $spell->id)->update('vocations', implode(',', $vocations)); + Spell::where('id', $spell->id)->update(['vocations' => implode(',', $vocations)]); } }; diff --git a/system/migrations/15.php b/system/migrations/15.php index 3907d5d7..eff04c42 100644 --- a/system/migrations/15.php +++ b/system/migrations/15.php @@ -5,7 +5,7 @@ // add new forum.guild and forum.access fields -$up = function ($db) { +$up = function () use ($db) { if (!$db->hasColumn(TABLE_PREFIX . 'forum_boards', 'guild')) { $db->addColumn(TABLE_PREFIX . 'forum_boards', 'guild', 'TINYINT(1) NOT NULL DEFAULT 0 AFTER `closed`'); } @@ -15,7 +15,7 @@ $up = function ($db) { } }; -$down = function ($db) { +$down = function () use ($db) { if ($db->hasColumn(TABLE_PREFIX . 'forum_boards', 'guild')) { $db->dropColumn(TABLE_PREFIX . 'forum_boards', 'guild'); } diff --git a/system/migrations/27.php b/system/migrations/27.php index 13c401a1..81d4fb81 100644 --- a/system/migrations/27.php +++ b/system/migrations/27.php @@ -1,12 +1,14 @@ first(); if (!$downloadsModel) { - Pages::create([ + $db->insert(TABLE_PREFIX . 'pages', [ 'name' => 'downloads', 'title' => 'Downloads', 'body' => file_get_contents(__DIR__ . '/27-downloads.html'), @@ -14,13 +16,13 @@ $up = function () { 'player_id' => 1, 'php' => 0, 'access' => 0, - 'hide' => 0, + 'hidden' => 0, ]); } $commandsModel = Pages::where('name', 'commands')->first(); if (!$commandsModel) { - Pages::create([ + $db->insert(TABLE_PREFIX . 'pages', [ 'name' => 'commands', 'title' => 'Commands', 'body' => file_get_contents(__DIR__ . '/27-commands.html'), @@ -28,7 +30,7 @@ $up = function () { 'player_id' => 1, 'php' => 0, 'access' => 0, - 'hide' => 0, + 'hidden' => 0, ]); } }; diff --git a/system/migrations/30.php b/system/migrations/30.php index be99aebe..2e38e468 100644 --- a/system/migrations/30.php +++ b/system/migrations/30.php @@ -6,7 +6,7 @@ $up = function () { $rulesOnPage = Pages::where('name', 'rules_on_the_page')->first(); if (!$rulesOnPage) { Pages::create([ - 'name' => 'downloads', + 'name' => 'rules_on_the_page', 'title' => 'Rules', 'body' => file_get_contents(__DIR__ . '/30-rules.txt'), 'date' => time(), @@ -14,7 +14,7 @@ $up = function () { 'php' => 0, 'enable_tinymce' => 0, 'access' => 0, - 'hide' => 0, + 'hidden' => 0, ]); } }; diff --git a/system/migrations/7.php b/system/migrations/7.php index 4c948519..a96ed7c9 100644 --- a/system/migrations/7.php +++ b/system/migrations/7.php @@ -3,13 +3,13 @@ * @var OTS_DB_MySQL $db */ -$up = function ($db) { +$up = function () use ($db) { if ($db->hasColumn(TABLE_PREFIX . 'screenshots', 'name')) { $db->dropColumn(TABLE_PREFIX . 'screenshots', 'name'); } }; -$up = function ($db) { +$up = function () use ($db) { if (!$db->hasColumn(TABLE_PREFIX . 'screenshots', 'name')) { $db->addColumn(TABLE_PREFIX . 'screenshots', 'name', 'VARCHAR(30) NOT NULL'); } diff --git a/system/migrations/8.php b/system/migrations/8.php index a192b273..54e9db9d 100644 --- a/system/migrations/8.php +++ b/system/migrations/8.php @@ -3,7 +3,7 @@ * @var OTS_DB_MySQL $db */ -$up = function ($db) { +$up = function () use ($db) { if ($db->hasTable(TABLE_PREFIX . 'forum_sections')) { $db->renameTable(TABLE_PREFIX . 'forum_sections', TABLE_PREFIX . 'forum_boards'); }