\Dewdrop\Db\Dbdeploy\CommandApply

This command actually applies the available changes to your database. You can optionally limit the command to a single changeset. After applying each change, it will be logged to the changelog in the database. If any script fails, execution will be halted immediately.

Summary

Methods
Properties
Constants
__construct()
execute()
getChangesAppliedCount()
getAppliedFilesByChangeset()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$changesets
$changelogGateway
$cliExec
$changeset
$changesAppliedCount
$appliedFilesByChangeset
N/A

Properties

$changesets

$changesets : array

The changesets for which changes should be applied.

Type

array

$changeset

$changeset : string

An optional changeset name. If specific, _only_ changes from the changeset with a matching name will be applied.

Type

string

$changesAppliedCount

$changesAppliedCount : integer

The number of changes that were applied during execution. Re-calculated on each call to execute(). Useful for summarizing the changes after execution.

Type

integer

$appliedFilesByChangeset

$appliedFilesByChangeset : array

The specific changes that were applied during execution. Re-calculated on each call to execute(). Useful for summarizing the changes after execution. Changes are grouped by changeset name.

Type

array

Methods

__construct()

__construct(\Dewdrop\Db\Dbdeploy\ChangelogGateway  $changelogGateway, array  $changesets, \Dewdrop\Db\Dbdeploy\CliExec  $cliExec, null  $changeset = null) 

The $changelogGateway and $cliExec params allow the command to interact with the database. The $changeset param is optional. If specified, it will limit the applied changes to a single named changeset.

Parameters

\Dewdrop\Db\Dbdeploy\ChangelogGateway $changelogGateway
array $changesets
\Dewdrop\Db\Dbdeploy\CliExec $cliExec
null $changeset

execute()

execute() : boolean

Apply changes to the database. After execution, you can get a count of the applied changes and an array of the change files applied.

Returns

boolean

getChangesAppliedCount()

getChangesAppliedCount() : integer

Get a count of the changes that were applied when execute() was last called.

Returns

integer

getAppliedFilesByChangeset()

getAppliedFilesByChangeset() : array

Get an array of the change files applied during the previous call to execute(), grouped by the changeset name.

Returns

array