Method | Description | |
---|---|---|
__construct ( |
Construct a Migration instance | |
getSql ( string $to = null ) : array | Get the array of versions and SQL queries that would be executed for each version but do not execute anything. | |
migrate ( string $to = null, boolean $dryRun = false, boolean $timeAllQueries = false, callable $confirm = null ) : array | Run a migration to the current version or the given target version. | |
setNoMigrationException ( boolean $noMigrationException = false ) | ||
writeSqlFile ( string $path, string $to = null ) : boolean | Write a migration SQL file to the given path |
Method | Description | |
---|---|---|
migrationsCanExecute ( callable $confirm = null ) | ||
noMigrations ( ) |
public __construct ( |
||
$configuration | A migration Configuration instance |
public migrate ( string $to = null, boolean $dryRun = false, boolean $timeAllQueries = false, callable $confirm = null ) : array | ||
$to | string | The version to migrate to. |
$dryRun | boolean | Whether or not to make this a dry run and not execute anything. |
$timeAllQueries | boolean | Measuring or not the execution time of each SQL query. |
$confirm | callable | A callback to confirm whether the migrations should be executed. |
return | array | An array of migration sql statements. This will be empty if the the $confirm callback declines to execute the migration |
public setNoMigrationException ( boolean $noMigrationException = false ) | ||
$noMigrationException | boolean | Throw an exception or not if no migration is found. Mostly for Continuous Integration. |