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,8 +1,12 @@
<?php
/**
* @var OTS_DB_MySQL $db
*/
// Increase size of page in myaac_visitors table
$up = function () use ($db) {
$db->exec('ALTER TABLE `' . TABLE_PREFIX . "visitors` MODIFY `page` VARCHAR(2048) NOT NULL;");
$db->modifyColumn(TABLE_PREFIX . 'visitors', 'page', 'VARCHAR(2048) NOT NULL');
};
$down = function () {