class PoppyMigrateResetCommand extends Command

Poppy Migrate Reset

Traits

ConfirmableTrait
MigrationTrait

Properties

protected string $name

The console command name.

protected string $description

The console command description.

protected Poppy $poppy
protected Migrator $migrator
protected Filesystem $files

Methods

requireMigrations(string $module)

Require (once) all migration files for the supplied module.

string
getMigrationPath(string $module)

Get migration directory path.

__construct(Poppy $poppy, Filesystem $files, Migrator $migrator)

Create a new command instance.

handle()

Execute the console command.

reset()

Run the migration reset for the current list of slugs.

runDown(string $file, string|object $migration)

Run "down" a migration instance.

array
getMigrationPaths()

Generate a list of all migration paths, given the arguments/operations supplied.

Collection|array
getSlugsToReset()

Using the arguments, generate a list of slugs to reset the migrations for.

bool
validSlugProvided()

Determine if a valid slug has been provided as an argument.

array
getParameters(string $slug)

Get the console command parameters.

array
getArguments()

Get the console command arguments.

array
getOptions()

Get the console command options.

Details

in MigrationTrait at line 18
protected requireMigrations(string $module)

Require (once) all migration files for the supplied module.

Parameters

string $module module

in MigrationTrait at line 36
protected string getMigrationPath(string $module)

Get migration directory path.

Parameters

string $module module

Return Value

string

at line 58
__construct(Poppy $poppy, Filesystem $files, Migrator $migrator)

Create a new command instance.

Parameters

Poppy $poppy
Filesystem $files
Migrator $migrator

at line 70
handle()

Execute the console command.

at line 85
protected reset()

Run the migration reset for the current list of slugs.

Migrations should be reset in the reverse order that they were migrated up as. This ensures the database is properly reversed without conflict.

at line 121
protected runDown(string $file, string|object $migration)

Run "down" a migration instance.

Parameters

string $file

migrate file

string|object $migration

migration file

at line 137
protected array getMigrationPaths()

Generate a list of all migration paths, given the arguments/operations supplied.

Return Value

array

at line 154
protected Collection|array getSlugsToReset()

Using the arguments, generate a list of slugs to reset the migrations for.

Return Value

Collection|array

at line 172
protected bool validSlugProvided()

Determine if a valid slug has been provided as an argument.

We will accept a slug as long as it is not empty and is enabled (or force is passed).

Return Value

bool

at line 194
protected array getParameters(string $slug)

Get the console command parameters.

Parameters

string $slug slug

Return Value

array

at line 219
protected array getArguments()

Get the console command arguments.

Return Value

array

at line 230
protected array getOptions()

Get the console command options.

Return Value

array