com\setasign\SetaFramework\Database\Migration
MigrationManager Class MigrationManager
File: /SetaFramework/src/Database/Migration/MigrationManager.php
Note: The migration manager is not transaction safe! Make sure that never multiple migration managers run at the same time and no other script changes the migrations table.
Class hierarchy
Implements
Summary
Constants
TABLE_NAME
Properties
$directory
$migrations
$name
Static Methods
buildMigrationTable()
Parameters
- $tableSchemaBuilder : \com\setasign\SetaFramework\Database\Manager\TableSchemaBuilder
Exceptions
Throws \com\setasign\SetaFramework\Database\Manager\TableSchemaBuilderException
Methods
__construct()
\com\setasign\SetaFramework\Database\TableInterface $migrationTable,
string $directory,
string $name
Parameters
- $database : \com\setasign\SetaFramework\Database\Database
- $migrationTable : \com\setasign\SetaFramework\Database\TableInterface
- $directory : string
- $name : string
revertSingleMigration()
revertUntil()
Parameters
- $dateTime : \DateTimeInterface
Return Values
Number of migrations which were installed
Exceptions
Throws MigrationDownException If an error happens while running down()
run()
Return Values
Number of migrations which were installed
Exceptions
Throws MigrationUpException If an error happens while running up()
Throws MigrationDownException If an error happens while running down()
Throws \com\setasign\SetaFramework\Exception If the migration row cannot be saved
runMigrationFailSafe()
Parameters
- $name : string
- $migration : MigrationInterface
Exceptions
Throws MigrationUpException If an error happens while running up()
Throws MigrationDownException If an error happens while running down()
Throws \com\setasign\SetaFramework\Exception If the migration row cannot be saved
runSingleMigration()
Parameters
- $name : string
Exceptions
Throws MigrationUpException If an error happens while running up()
Throws MigrationDownException If an error happens while running down()
Throws \com\setasign\SetaFramework\Exception If the migration row cannot be saved
Throws \InvalidArgumentException If the migration is unknown or already installed
