MigrateCleanCommand extends MigrateCommand
migrate:clean Bakery Command Remove stale migrations from the database.
Tags
Table of Contents
$io | SymfonyStyle | |
---|---|---|
$ci | ContainerInterface | |
configure() | {@inheritdoc} | mixed |
execute() | {@inheritdoc} | mixed |
cleanStaleRecords() | Delete stale migrations from the database. | mixed |
getStaleRecords() | Return an array of stale migrations. | Collection |
configure() | {@inheritdoc} | mixed |
execute() | {@inheritdoc} | mixed |
setupMigrator() | Setup migrator and the shared options between other command. | Migrator |
displayNotes() | Display migrator notes. | mixed |
confirmToProceed() | Confirm before proceeding with the action. | bool |
getDefaultConfirmCallback() | Get the default confirmation callback. | Closure |
initialize() | {@inheritdoc} | mixed |
setContainer() | Setup the global container object. | void |
isProduction() | Return if the app is in production mode. | bool |
Properties
$io
protected
SymfonyStyle
$io
Tags
$ci
protected
ContainerInterface
$ci
Methods
configure()
{@inheritdoc}
protected
configure(
)
: mixed
Return values
mixedexecute()
{@inheritdoc}
protected
execute(
$input :
InputInterface
, $output :
OutputInterface
)
: mixed
Parameters
- $input : InputInterface
- $output : OutputInterface
Return values
mixedcleanStaleRecords()
Delete stale migrations from the database.
protected
cleanStaleRecords(
$stale :
Collection
, $migrator :
Migrator
)
: mixed
Parameters
- $stale : Collection
Collection of stale migartion classes.
- $migrator : Migrator
Migrator object
Return values
mixedgetStaleRecords()
Return an array of stale migrations.
protected
getStaleRecords(
$ran :
Collection
, $available :
array
)
: Collection
A migration is stale if not found in the available stack (class is not in the Filesystem).
Parameters
- $ran : Collection
The ran migrations
- $available : array
The available migrations
Return values
Collection —Collection of stale migration classes.
configure()
{@inheritdoc}
protected
configure(
)
: mixed
Return values
mixedexecute()
{@inheritdoc}
protected
execute(
$input :
InputInterface
, $output :
OutputInterface
)
: mixed
Parameters
- $input : InputInterface
- $output : OutputInterface
Return values
mixedsetupMigrator()
Setup migrator and the shared options between other command.
protected
setupMigrator(
$input :
InputInterface
)
: Migrator
Parameters
- $input : InputInterface
Return values
Migrator —The migrator instance
displayNotes()
Display migrator notes.
protected
displayNotes(
$migrator :
Migrator
)
: mixed
Parameters
- $migrator : Migrator
Return values
mixedconfirmToProceed()
Confirm before proceeding with the action.
public
confirmToProceed(
[ $force :
bool
= false ]
[, $warning :
string
= 'Application In Production Mode!' ]
[, $callback :
Closure|bool|null
= null ]
)
: bool
This method only asks for confirmation in production.
Parameters
- $force : bool = false
- $warning : string = 'Application In Production Mode!'
- $callback : Closure|bool|null = null
Return values
boolgetDefaultConfirmCallback()
Get the default confirmation callback.
protected
getDefaultConfirmCallback(
)
: Closure
Return values
Closureinitialize()
{@inheritdoc}
protected
initialize(
$input :
InputInterface
, $output :
OutputInterface
)
: mixed
Parameters
- $input : InputInterface
- $output : OutputInterface
Return values
mixedsetContainer()
Setup the global container object.
public
setContainer(
$ci :
ContainerInterface
)
: void
Parameters
- $ci : ContainerInterface
isProduction()
Return if the app is in production mode.
protected
isProduction(
)
: bool
@return bool True/False if the app is in production mode