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,5 +1,14 @@
<?php
/**
* @var OTS_DB_MySQL $db
*/
// change size of spells.vocations
$db->query("ALTER TABLE `" . TABLE_PREFIX . "spells` MODIFY `vocations` VARCHAR(300) NOT NULL DEFAULT '';");
?>
$up = function () use ($db) {
$db->modifyColumn(TABLE_PREFIX . 'spells', 'vocations', "VARCHAR(300) NOT NULL DEFAULT ''");
};
$down = function () {
// nothing to do here
};