/** * Execute the console command. * * @return mixed */ public function handle() { // Obtener las bases de datos $bds = BaseDatosCadeco::all(); $this->output->progressStart(count($bds)); foreach ($bds as $bd) { $this->output->newLine(); $this->info('Revirtiendo la ultima migracion en ' . $bd->nombre); $this->config->set('database.connections.' . $this->argument('connection') . '.database', $bd->nombre); $this->call('migrate:rollback', ['--database' => $this->argument('connection')]); DB::disconnect($this->argument('connection')); $this->output->progressAdvance(); } $this->output->progressFinish(); }
/** * Execute the console command. * * @return mixed */ public function handle() { // Obtener las bases de datos $bds = BaseDatosCadeco::all(); $this->output->progressStart(count($bds)); foreach ($bds as $bd) { $this->output->newLine(); $this->info('Ejecutando migraciones en ' . $bd->nombre); $this->config->set('database.connections.' . $this->argument('connection') . '.database', $bd->nombre); if ($this->option('path')) { $this->call('migrate', ['--database' => $this->argument('connection'), '--path' => $this->option('path')]); } $this->call('migrate', ['--database' => $this->argument('connection')]); if ($this->option('seed')) { $this->call('db:seed', ['--force' => true, '--database' => $this->argument('connection')]); } DB::disconnect($this->argument('connection')); $this->output->progressAdvance(); } $this->output->progressFinish(); }