예제 #1
0
 /**
  * Generate new migration skeleton class
  *
  * @return string path to new skeleton class file
  * @throws \Exception
  */
 public function generate()
 {
     $className = 'Version_' . date('YmdHis', time());
     $classPath = $this->migrationsDir . DIRECTORY_SEPARATOR . $className . '.php';
     if ($this->filesystem->exists($classPath)) {
         throw new RuntimeException(sprintf('Migration %s exists!', $className));
     }
     $this->filesystem->put($classPath, $this->getTemplate($className));
     return $classPath;
 }