Refactor migrations with $up & $down

This commit is contained in:
slawkens
2024-11-08 07:04:24 +01:00
parent c7cb00f8da
commit 8aff9f36fb
49 changed files with 842 additions and 370 deletions

View File

@@ -1,3 +1,12 @@
<?php
/**
* @var OTS_DB_MySQL $db
*/
$db->exec('ALTER TABLE `' . TABLE_PREFIX . 'monsters` MODIFY `loot` text NOT NULL;');
$up = function () use ($db) {
$db->modifyColumn(TABLE_PREFIX . 'monsters', 'loot', 'text NOT NULL');
};
$down = function () {
// nothing to do
};