From 187baf05d428a1c196e5d3d8fa2516907c7ac3f8 Mon Sep 17 00:00:00 2001 From: dyzulk <66510723+dyzulk@users.noreply.github.com> Date: Wed, 7 Jan 2026 10:09:27 +0700 Subject: [PATCH] feat: add trustlab:migrate-ca command for simplified CA migrations --- app/Console/Commands/TrustLabMigrateCa.php | 61 ++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 app/Console/Commands/TrustLabMigrateCa.php diff --git a/app/Console/Commands/TrustLabMigrateCa.php b/app/Console/Commands/TrustLabMigrateCa.php new file mode 100644 index 0000000..ed9e415 --- /dev/null +++ b/app/Console/Commands/TrustLabMigrateCa.php @@ -0,0 +1,61 @@ +info('Starting TrustLab CA Migration...'); + + $parameters = [ + '--database' => 'mysql_ca', + '--path' => 'database/migrations/ca', + ]; + + if ($this->option('force')) { + $parameters['--force'] = true; + } + + if ($this->option('seed')) { + $parameters['--seed'] = true; + } + + $command = $this->option('fresh') ? 'migrate:fresh' : 'migrate'; + + $this->comment("Running command: php artisan {$command} --database=mysql_ca --path=database/migrations/ca " . ($this->option('force') ? '--force' : '')); + + $exitCode = Artisan::call($command, $parameters, $this->output); + + if ($exitCode === 0) { + $this->info('CA Migration completed successfully.'); + } else { + $this->error('CA Migration failed.'); + } + + return $exitCode; + } +}