migrate command: show "Already on latest version"

This commit is contained in:
slawkens
2025-10-24 21:14:49 +02:00
parent 07fd034fe4
commit 727f68a575
2 changed files with 12 additions and 0 deletions

View File

@@ -9,6 +9,8 @@
*/
defined('MYAAC') or die('Direct access not allowed!');
global $db;
// database migrations
$tmp = '';
if(fetchDatabaseConfig('database_version', $tmp)) { // we got version

View File

@@ -22,6 +22,16 @@ class MigrateCommand extends Command
$this->init();
$io = new SymfonyStyle($input, $output);
$tmp = '';
if(fetchDatabaseConfig('database_version', $tmp)) { // we got version
$tmp = (int)$tmp;
if ($tmp >= DATABASE_VERSION) {
$io->success('Already on latest version.');
return Command::SUCCESS;
}
}
require SYSTEM . 'migrate.php';
$io->success('Migrated to latest version (' . DATABASE_VERSION . ')');