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; + } +}