public function run(array $params = [])
	{
		$runner = Services::migrations();

		// Get the version number
		$version = array_shift($params);

		if (is_null($version))
		{
			$version = CLI::prompt(lang('Migrations.version'));
		}

		if (is_null($version))
		{
			CLI::error(lang('Migrations.invalidVersion'));
			exit();
		}

		CLI::write(sprintf(lang('Migrations.toVersionPH'), $version), 'yellow');

		$namespace = $params['-n'] ?? CLI::getOption('n');
		$group     = $params['-g'] ?? CLI::getOption('g');

		try
		{
			$runner->version($version, $namespace, $group);
			CLI::write('Done');
		}
		catch (\Exception $e)
		{
			$this->showError($e);
		}
	}
public function run(array $params = [])
	{
		$runner = Services::migrations();

		// Get the version number
		$version = array_shift($params);

		if (is_null($version))
		{
			$version = CLI::prompt(lang('Migrations.version'));
		}

		if (is_null($version))
		{
			CLI::error(lang('Migrations.invalidVersion'));
			exit();
		}

		CLI::write(sprintf(lang('Migrations.toVersionPH'), $version), 'yellow');

		$namespace = $params['-n'] ?? CLI::getOption('n');
		$group     = $params['-g'] ?? CLI::getOption('g');

		try
		{
			$runner->version($version, $namespace, $group);
			CLI::write('Done');
		}
		catch (\Exception $e)
		{
			$this->showError($e);
		}
	}
public function run ( array $ params = [ ] ) { $ runner = Services :: migrations ( ) ; // Get the version number $ version = array_shift ( $ params ) ; if ( is_null ( $ version ) ) { $ version = CLI :: prompt ( lang ( 'Migrations.version' ) ) ; } if ( is_null ( $ version ) ) { CLI :: error ( lang ( 'Migrations.invalidVersion' ) ) ; exit ( ) ; } CLI :: write ( sprintf ( lang ( 'Migrations.toVersionPH' ) , $ version ) , 'yellow' ) ; $ namespace = $ params [ '-n' ] ?? CLI :: getOption ( 'n' ) ; $ group = $ params [ '-g' ] ?? CLI :: getOption ( 'g' ) ; try { $ runner -> version ( $ version , $ namespace , $ group ) ; CLI :: write ( 'Done' ) ; } catch ( \ Exception $ e ) { $ this -> showError ( $ e ) ; } }
Migrates the database up or down to get to the specified version.

@param array $params
Migrates the database up or down to get to the specified version .