Esempio n. 1
0
 public function handle($request)
 {
     parent::handle($request);
     $this->initTracker();
     $migrations = $this->app->getTrackedMigrations();
     $this->checkNonMigrated($migrations);
     foreach ($migrations as $id => $migration) {
         if ($migration->status == 'new') {
             $this->printMigration($migration);
             $this->register($migration);
             if (!empty($migration->before)) {
                 $this->setStatus($migration, 'before');
                 Utilities::exec($migration->before);
             }
             $this->setStatus($migration, 'loading...');
             $this->app->getTracker()->load($migration);
             if (!empty($migration->after)) {
                 $this->setStatus($migration, 'after');
                 Utilities::exec($migration->after);
             }
             $this->setStatus($migration, 'migrated');
             echo "\n";
         }
     }
     echo "All migrated\n";
 }
Esempio n. 2
0
 public function handle($request)
 {
     parent::handle($request);
     try {
         $this->testDependencies();
         $this->handleBody();
     } catch (\Exception $e) {
         echo "Error: " . $e->getMessage() . "\n";
         exit(1);
     }
 }
 public function handle($request)
 {
     parent::handle($request);
     $this->loadMigrationParameters();
     $this->printParameters();
 }