Migrator (Database\Migrations)

Migrator

class Migrator (View source)

Methods

void __construct(MigrationRepositoryInterface $repository, ConnectionResolverInterface $resolver, Filesystem $files)

Create a new migrator instance.

array run(array|string $paths = array(), array $options = array())

Run the pending migrations at a given path.

void runPending(array $migrations, array $options = array())

Run an array of migrations.

array rollback(array|string $paths = array(), array $options = array())

Rollback the last migration operation.

array reset(array|string $paths = array(), bool $pretend = false)

Rolls all of the currently applied migrations back.

object resolve(string $file)

Resolve a migration instance from a file.

array getMigrationFiles(string|array $paths)

Get all of the migration files in a given path.

void requireFiles(array $files)

Require in all the migration files in a given path.

string getMigrationName(string $path)

Get the name of the migration.

void path(string $path)

Register a custom migration path.

array paths()

Get all of the custom migration paths.

void setConnection(string $name)

Set the default connection name.

Connection resolveConnection(string $connection)

Resolve the database connection instance.

MigrationRepositoryInterface getRepository()

Get the migration repository instance.

bool repositoryExists()

Determine if the migration repository exists.

Filesystem getFilesystem()

Get the file system instance.

array getNotes()

Get the notes for the last operation.

Details

void __construct(MigrationRepositoryInterface $repository, ConnectionResolverInterface $resolver, Filesystem $files)

Create a new migrator instance.

Parameters

MigrationRepositoryInterface $repository
ConnectionResolverInterface $resolver
Filesystem $files

Return Value

void

array run(array|string $paths = array(), array $options = array())

Run the pending migrations at a given path.

Parameters

array|string $paths
array $options

Return Value

array

void runPending(array $migrations, array $options = array())

Run an array of migrations.

Parameters

array $migrations
array $options

Return Value

void

array rollback(array|string $paths = array(), array $options = array())

Rollback the last migration operation.

Parameters

array|string $paths
array $options

Return Value

array

array reset(array|string $paths = array(), bool $pretend = false)

Rolls all of the currently applied migrations back.

Parameters

array|string $paths
bool $pretend

Return Value

array

object resolve(string $file)

Resolve a migration instance from a file.

Parameters

string $file

Return Value

object

array getMigrationFiles(string|array $paths)

Get all of the migration files in a given path.

Parameters

string|array $paths

Return Value

array

void requireFiles(array $files)

Require in all the migration files in a given path.

Parameters

array $files

Return Value

void

string getMigrationName(string $path)

Get the name of the migration.

Parameters

string $path

Return Value

string

void path(string $path)

Register a custom migration path.

Parameters

string $path

Return Value

void

array paths()

Get all of the custom migration paths.

Return Value

array

void setConnection(string $name)

Set the default connection name.

Parameters

string $name

Return Value

void

Connection resolveConnection(string $connection)

Resolve the database connection instance.

Parameters

string $connection

Return Value

Connection

MigrationRepositoryInterface getRepository()

Get the migration repository instance.

bool repositoryExists()

Determine if the migration repository exists.

Return Value

bool

Filesystem getFilesystem()

Get the file system instance.

Return Value

Filesystem

array getNotes()

Get the notes for the last operation.

Return Value

array

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.4/Illuminate/Database/Migrations/Migrator.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部