src/mako/application/cli/commands/migrations/traits/RollbackTrait.php
public function rollback(?int $batches = null): void
	{
		$migrations = $this->getMigrated($batches);

		if($migrations->isEmpty())
		{
			$this->write('<blue>There are no migrations to roll back.</blue>');

			return;
		}

		foreach($migrations as $migration)
		{
			$this->runMigration($migration, 'down');
		}

		$this->write('Rolled back the following migrations:' . PHP_EOL);

		$this->outputMigrationList($migrations->getItems());
	}
public function rollback(?int $batches = null): void
	{
		$migrations = $this->getMigrated($batches);

		if($migrations->isEmpty())
		{
			$this->write('<blue>There are no migrations to roll back.</blue>');

			return;
		}

		foreach($migrations as $migration)
		{
			$this->runMigration($migration, 'down');
		}

		$this->write('Rolled back the following migrations:' . PHP_EOL);

		$this->outputMigrationList($migrations->getItems());
	}
public function rollback ( ? int $ batches = null ) : void { $ migrations = $ this -> getMigrated ( $ batches ) ; if ( $ migrations -> isEmpty ( ) ) { $ this -> write ( '<blue>There are no migrations to roll back.</blue>' ) ; return ; } foreach ( $ migrations as $ migration ) { $ this -> runMigration ( $ migration , 'down' ) ; } $ this -> write ( 'Rolled back the following migrations:' . PHP_EOL ) ; $ this -> outputMigrationList ( $ migrations -> getItems ( ) ) ; }
Rolls back n batches.

@param int|null $batches Number of batches to roll back
Rolls back n batches .