protected function create(Array $arguments=[])
	{
		$migrationsDirectory = $this->cmd->getConfigOpt('migrations_storage');
		$templateTags = [];

		$migrationName = $this->cmd->question('Migration filename?');
		$filename = trim($migrationName);

		$path = $migrationsDirectory . '/' . $filename . '.php';

		if (file_exists($path)) {
			throw new MigrationFileInvalidException(
				sprintf(
					'Migration file [%s] exists.',
					$filename
				)
			);
		}

		$templateTags['phx:class'] = Helper::getQualifiedClassName($filename);

		$builder = new TemplateBuilder($this->cmd, $this->env);
		$builder->createClassTemplate('migration', $filename, $migrationsDirectory, $templateTags);

		// After migration class has been created, the record needs to go to the database and be set to pending.
		$model = new Model();
		$model->class_name = $templateTags['phx:class'];
		$model->status = Attribute::STATUS_PENDING;
		$model->path = $path;
		$model->save();

		$this->env->sendOutput('Created migration is now pending', 'green');
	}
protected function create(Array $arguments=[])
	{
		$migrationsDirectory = $this->cmd->getConfigOpt('migrations_storage');
		$templateTags = [];

		$migrationName = $this->cmd->question('Migration filename?');
		$filename = trim($migrationName);

		$path = $migrationsDirectory . '/' . $filename . '.php';

		if (file_exists($path)) {
			throw new MigrationFileInvalidException(
				sprintf(
					'Migration file [%s] exists.',
					$filename
				)
			);
		}

		$templateTags['phx:class'] = Helper::getQualifiedClassName($filename);

		$builder = new TemplateBuilder($this->cmd, $this->env);
		$builder->createClassTemplate('migration', $filename, $migrationsDirectory, $templateTags);

		// After migration class has been created, the record needs to go to the database and be set to pending.
		$model = new Model();
		$model->class_name = $templateTags['phx:class'];
		$model->status = Attribute::STATUS_PENDING;
		$model->path = $path;
		$model->save();

		$this->env->sendOutput('Created migration is now pending', 'green');
	}
protected function create ( Array $ arguments = [ ] ) { $ migrationsDirectory = $ this -> cmd -> getConfigOpt ( 'migrations_storage' ) ; $ templateTags = [ ] ; $ migrationName = $ this -> cmd -> question ( 'Migration filename?' ) ; $ filename = trim ( $ migrationName ) ; $ path = $ migrationsDirectory . '/' . $ filename . '.php' ; if ( file_exists ( $ path ) ) { throw new MigrationFileInvalidException ( sprintf ( 'Migration file [%s] exists.' , $ filename ) ) ; } $ templateTags [ 'phx:class' ] = Helper :: getQualifiedClassName ( $ filename ) ; $ builder = new TemplateBuilder ( $ this -> cmd , $ this -> env ) ; $ builder -> createClassTemplate ( 'migration' , $ filename , $ migrationsDirectory , $ templateTags ) ; // After migration class has been created, the record needs to go to the database and be set to pending.
 $ model = new Model ( ) ; $ model -> class_name = $ templateTags [ 'phx:class' ] ; $ model -> status = Attribute :: STATUS_PENDING ; $ model -> path = $ path ; $ model -> save ( ) ; $ this -> env -> sendOutput ( 'Created migration is now pending' , 'green' ) ; }
Creates a migration.

@param 	$arguments <Array>
@access 	protected
@return 	<void>
Creates a migration .