src/Database/Migration.php
/**
	 * Runs the migration normally, executing the directional method and saving a record to the schema table. If there
	 * is an error, an exception will be thrown.
	 *
	 * @param Migrator $migrator
	 * @param MigrationBatch $batch
	 * @return void
	 */
Runs the migration normally, executing the directional method and saving a record to the schema table. If there
is an error, an exception will be thrown.

@param Migrator $migrator
@param MigrationBatch $batch
@return void
Runs the migration normally executing the directional method and saving a record to the schema table . If there is an error an exception will be thrown . @param Migrator $migrator @param MigrationBatch $batch @return void
private function runAsMigration(Migrator $migrator, MigrationBatch $batch) {
		$connectionName = $this->getConnectionName();
		$schemaConnection = $migrator->getConnection();
		$startTime = time();
		Schema::withDefaultConnection($connectionName, function() use($migrator) {
			$this->executeDirectionMethod($migrator);
		});
		if ($migrator->direction === Migrator::DIRECTION_UP) {
			$record = array(
				'name' => $this->getRecordName(),
				'batch' => $batch->getId(),
				'migration_time' => timestamp_to_datetime($startTime)
			);
			$record['id'] = $schemaConnection->insert()->into('@schema')->values($record)->exec();
			$migrator->setBatchMilestone(
				$batch,
				$this,
				$record
			);
		}
		else {
			$schemaConnection->delete()->from('@schema')->where('id', '=', $this->getRecordId())->exec();
			$migrator->removeBatchMilestone(
				$batch,
				$this
			);
		}
	}
private function runAsMigration ( Migrator $ migrator , MigrationBatch $ batch ) { $ connectionName = $ this -> getConnectionName ( ) ; $ schemaConnection = $ migrator -> getConnection ( ) ; $ startTime = time ( ) ; Schema :: withDefaultConnection ( $ connectionName , function ( ) use ( $ migrator ) { $ this -> executeDirectionMethod ( $ migrator ) ; } ) ; if ( $ migrator -> direction === Migrator :: DIRECTION_UP ) { $ record = array ( 'name' => $ this -> getRecordName ( ) , 'batch' => $ batch -> getId ( ) , 'migration_time' => timestamp_to_datetime ( $ startTime ) ) ; $ record [ 'id' ] = $ schemaConnection -> insert ( ) -> into ( '@schema' ) -> values ( $ record ) -> exec ( ) ; $ migrator -> setBatchMilestone ( $ batch , $ this , $ record ) ; } else { $ schemaConnection -> delete ( ) -> from ( '@schema' ) -> where ( 'id' , '=' , $ this -> getRecordId ( ) ) -> exec ( ) ; $ migrator -> removeBatchMilestone ( $ batch , $ this ) ; } }
Runs the migration normally, executing the directional method and saving a record to the schema table.
Runs the migration normally executing the directional method and saving a record to the schema table .
// For upward migrations, create a new record in the schema table // For downward migrations, delete the record from the schema table