Пример #1
0
 /**
  * @return void
  */
 protected function prepareDatabase()
 {
     $this->migrator->setConnection($this->input->getOption('database'));
     if (!$this->migrator->repositoryExists()) {
         $options = ['--database' => $this->input->getOption('database')];
         $this->call('migrate:install', $options);
     }
 }
Пример #2
0
 /**
  * @return void
  */
 public function fire()
 {
     $this->migrator->setConnection($this->input->getOption('database'));
     $pretend = $this->input->getOption('pretend');
     $this->migrator->rollback($pretend);
     foreach ($this->migrator->getNotes() as $note) {
         $this->output->writeln($note);
     }
 }
Пример #3
0
 /**
  * Execute the console command.
  * @return void
  */
 public function fire()
 {
     $this->migrator->setConnection($this->input->getOption('database'));
     if (!$this->migrator->repositoryExists()) {
         $this->output->writeln('<comment>Migration table not found.</comment>');
         return;
     }
     $pretend = $this->input->getOption('pretend');
     $this->migrator->reset($pretend);
     foreach ($this->migrator->getNotes() as $note) {
         $this->output->writeln($note);
     }
 }
Пример #4
0
 /**
  * @param string $path
  * @return array
  */
 protected function getAllMigrationFiles($path)
 {
     return $this->migrator->getMigrationFiles($path);
 }