class MigrationCommand extends AbstractCommand (View source)

Traits

Properties

protected Setting $setting

Store dirname

from  AbstractCommand
protected array $namespaces

The application namespace

from  AbstractCommand
protected Argument $arg

The Arg Option instance

from  AbstractCommand

Methods

void
throwFailsCommand(string $message, string|null $command = null)

Throw fails command

void
__construct(Setting $setting, Argument $arg)

AbstractCommand constructor

void
migrate()

Make a migration command

void
rollback()

Rollback migration command

void
reset()

Reset migration command

void
makeUp(array $current_migrations, array $migrations)

Up migration

void
makeRollback(array $current_migrations, array $migrations)

Rollback migration

void
makeReset(array $current_migrations, array $migrations)

Reset migration

void
generate(string $model)

Create a migration command

Details

protected void throwFailsCommand(string $message, string|null $command = null)

Throw fails command

Parameters

string $message
string|null $command

Return Value

void

Exceptions

ErrorException

void __construct(Setting $setting, Argument $arg)

AbstractCommand constructor

Parameters

Setting $setting
Argument $arg

Return Value

void

void migrate()

Make a migration command

Return Value

void

Exceptions

Exception

void rollback()

Rollback migration command

Return Value

void

Exceptions

Exception

void reset()

Reset migration command

Return Value

void

Exceptions

Exception

protected void makeUp(array $current_migrations, array $migrations)

Up migration

Parameters

array $current_migrations
array $migrations

Return Value

void

protected void makeRollback(array $current_migrations, array $migrations)

Rollback migration

Parameters

array $current_migrations
array $migrations

Return Value

void

protected void makeReset(array $current_migrations, array $migrations)

Reset migration

Parameters

array $current_migrations
array $migrations

Return Value

void

void generate(string $model)

Create a migration command

Parameters

string $model

Return Value

void

Exceptions

ErrorException