From 727f68a57594b7d98682024b6aac778804ad84a1 Mon Sep 17 00:00:00 2001 From: slawkens Date: Fri, 24 Oct 2025 21:14:49 +0200 Subject: [PATCH] migrate command: show "Already on latest version" --- system/migrate.php | 2 ++ system/src/Commands/MigrateCommand.php | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/system/migrate.php b/system/migrate.php index 2199fd73..2bbb3786 100644 --- a/system/migrate.php +++ b/system/migrate.php @@ -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 diff --git a/system/src/Commands/MigrateCommand.php b/system/src/Commands/MigrateCommand.php index 73868ce3..fe110190 100644 --- a/system/src/Commands/MigrateCommand.php +++ b/system/src/Commands/MigrateCommand.php @@ -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 . ')');