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
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. | |
void | runUp(string $file, int $batch, bool $pretend) Run "up" a migration instance. | |
int | rollback(bool $pretend = false) Rollback the last migration operation. | |
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. | |
void | pretendToRun(object $migration, string $method) Pretend to run the migrations. | |
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. | |
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. |
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.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/4.2/Illuminate/Database/Migrations/Migrator.html