/** * Execute the console command. * * @param \Jumilla\Versionia\Laravel\Migrator $migrator * * @return mixed */ public function handle(Migrator $migrator) { if (!$this->confirmToProceed()) { return; } $migrator->makeLogTable(); $this->migrateToLatest($migrator); $seed = $this->option('seed'); if ($seed) { $this->call('database:seed', ['name' => $seed, '--force' => true]); } }
/** * Execute the console command. * * @param \Jumilla\Versionia\Laravel\Migrator $migrator * * @return mixed */ public function handle(Migrator $migrator) { if (!$this->confirmToProceed()) { return; } $migrator->makeLogTable(); $installed_migrations = $migrator->installedMigrationsByDesc(); foreach ($installed_migrations as $group => $migrations) { foreach ($migrations as $data) { $this->infoDowngrade($group, $data->version, $data->class); $migrator->doDowngrade($group, $data->version); } } }
/** * Execute the console command. * * @param \Jumilla\Versionia\Laravel\Migrator $migrator * * @return mixed */ public function handle(Migrator $migrator) { if (!$this->confirmToProceed()) { return; } $group = $this->argument('group'); // check valid group if (!in_array($group, $migrator->migrationGroups())) { throw new UnexpectedValueException("Migation group '{$group}' is not defined."); } $migrator->makeLogTable(); $this->doAgain($migrator, $group); $seed = $this->option('seed'); if ($seed) { $this->call('database:seed', ['name' => $seed, '--force' => true]); } }
/** * Execute the console command. * * @param \Jumilla\Versionia\Laravel\Migrator $migrator * * @return mixed */ public function handle(Migrator $migrator) { $migrator->makeLogTable(); $this->showMigrations($migrator); $this->showSeeds($migrator); }