mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-26 14:04:17 +01:00
migrate command: show "Already on latest version"
This commit is contained in:
@@ -9,6 +9,8 @@
|
|||||||
*/
|
*/
|
||||||
defined('MYAAC') or die('Direct access not allowed!');
|
defined('MYAAC') or die('Direct access not allowed!');
|
||||||
|
|
||||||
|
global $db;
|
||||||
|
|
||||||
// database migrations
|
// database migrations
|
||||||
$tmp = '';
|
$tmp = '';
|
||||||
if(fetchDatabaseConfig('database_version', $tmp)) { // we got version
|
if(fetchDatabaseConfig('database_version', $tmp)) { // we got version
|
||||||
|
|||||||
@@ -22,6 +22,16 @@ class MigrateCommand extends Command
|
|||||||
$this->init();
|
$this->init();
|
||||||
|
|
||||||
$io = new SymfonyStyle($input, $output);
|
$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';
|
require SYSTEM . 'migrate.php';
|
||||||
|
|
||||||
$io->success('Migrated to latest version (' . DATABASE_VERSION . ')');
|
$io->success('Migrated to latest version (' . DATABASE_VERSION . ')');
|
||||||
|
|||||||
Reference in New Issue
Block a user