Migrator
class Migrator (View source)
Properties
protected MigrationRepositoryInterface | $repository | The migration repository implementation. |
|
protected Filesystem | $files | The filesystem instance. |
|
protected ConnectionResolverInterface | $resolver | The connection resolver instance. |
|
protected string | $connection | The name of the default connection. |
|
protected array | $notes | The notes for the current operation. |
Methods
Create a new migrator instance.
Run the outstanding migrations at a given path.
Run an array of migrations.
Run "up" a migration instance.
Rollback the last migration operation.
Run "down" a migration instance.
Get all of the migration files in a given path.
Require in all the migration files in a given path.
Pretend to run the migrations.
Get all of the queries that would be run for a migration.
Resolve a migration instance from a file.
Raise a note event for the migrator.
Get the notes for the last operation.
Resolve the database connection instance.
Set the default connection name.
Get the migration repository instance.
Determine if the migration repository exists.
Get the file system instance.
Details
void
__construct(MigrationRepositoryInterface $repository, ConnectionResolverInterface $resolver, Filesystem $files)
Create a new migrator instance.
void
run(string $path, bool $pretend = false)
Run the outstanding migrations at a given path.
void
runMigrationList(array $migrations, bool $pretend = false)
Run an array of migrations.
protected void
runUp(string $file, int $batch, bool $pretend)
Run "up" a migration instance.
int
rollback(bool $pretend = false)
Rollback the last migration operation.
protected void
runDown(object $migration, bool $pretend)
Run "down" a migration instance.
array
getMigrationFiles(string $path)
Get all of the migration files in a given path.
void
requireFiles(string $path, array $files)
Require in all the migration files in a given path.
protected void
pretendToRun(object $migration, string $method)
Pretend to run the migrations.
protected array
getQueries(object $migration, string $method)
Get all of the queries that would be run for a migration.
object
resolve(string $file)
Resolve a migration instance from a file.
protected void
note(string $message)
Raise a note event for the migrator.
array
getNotes()
Get the notes for the last operation.
Connection
resolveConnection(string $connection)
Resolve the database connection instance.
void
setConnection(string $name)
Set the default connection name.
MigrationRepositoryInterface
getRepository()
Get the migration repository instance.
bool
repositoryExists()
Determine if the migration repository exists.
Filesystem
getFilesystem()
Get the file system instance.