Copied!

MigrationService

MigrationService.php : 13

Methods

publicadd()

MigrationService.php : 20

Adds a migration into their storage.

public add(Migration $migration) : void

Parameters

Name Type Default value Description
$migration Migration - -
Tags
Throws
MigrationAlreadyExistsException

if adding migration would cause an existing migration to become overwritten

publicexecuteAll()

MigrationService.php : 55

Executes all available (present in migration storage) migration that are not yet executed.

public executeAll([string|null $userLogin = null ]) : void

Parameters

Name Type Default value Description
$userLogin string|null null

User login to execute migrations as. I not passed a default one should be used.

Tags
Throws
UnhandledMigrationException

when Migration execution fails.

Throws
InvalidMigrationException

when Migration format is invalid.

Throws
MigrationAlreadyExecutedException

when migration is already present in metadata storage.

publicexecuteOne()

MigrationService.php : 44

Executes a single migration and stores the result in metadata storage.

public executeOne(Migration $migration[, string|null $userLogin = null ]) : void

Parameters

Name Type Default value Description
$migration Migration - -
$userLogin string|null null

User login to execute migrations as. If not passed a default one should be used.

Tags
Throws
UnhandledMigrationException

when Migration execution fails.

Throws
InvalidMigrationException

when Migration format is invalid.

Throws
MigrationAlreadyExecutedException

when migration is already present in metadata storage.

publicfindOneByName()

MigrationService.php : 62

Find a single Migration.

public findOneByName(string $name) : Migration|null

Parameters

Name Type Default value Description
$name string - -

Return values

Migration|null

publicisMigrationExecuted()

MigrationService.php : 32

Checks if Migration is already marked as executed in database.

public isMigrationExecuted(Migration $migration) : bool

Parameters

Name Type Default value Description
$migration Migration - -

Return values

bool

publiclistMigrations()

MigrationService.php : 27

Return Migrations ordered alphabetically by their names.

public listMigrations() : array<string|int, Migration>

Return values

array<string|int, Migration>