class Migrator (View source)

Methods

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

Create a new migrator instance.

void
run( string $path, array $options = array())

Run the outstanding migrations at a given path.

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

Run an array of migrations.

int
rollback( bool $pretend = false)

Rollback the last migration operation.

int
reset( bool $pretend = false)

Rolls all of the currently applied migrations back.

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.

object
resolve( string $file)

Resolve a migration instance from a file.

array
getNotes()

Get the notes for the last operation.

resolveConnection( string $connection)

Resolve the database connection instance.

void
setConnection( string $name)

Set the default connection name.

getRepository()

Get the migration repository instance.

bool
repositoryExists()

Determine if the migration repository exists.

getFilesystem()

Get the file system instance.

Details

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

Create a new migrator instance.

Parameters

MigrationRepositoryInterface $repository
ConnectionResolverInterface $resolver
Filesystem $files

Return Value

void

at line line 71
void run( string $path, array $options = array())

Run the outstanding migrations at a given path.

Parameters

string $path
array $options

Return Value

void

at line line 96
void runMigrationList( array $migrations, array $options = array())

Run an array of migrations.

Parameters

array $migrations
array $options

Return Value

void

at line line 163
int rollback( bool $pretend = false)

Rollback the last migration operation.

Parameters

bool $pretend

Return Value

int

at line line 194
int reset( bool $pretend = false)

Rolls all of the currently applied migrations back.

Parameters

bool $pretend

Return Value

int

at line line 249
array getMigrationFiles( string $path)

Get all of the migration files in a given path.

Parameters

string $path

Return Value

array

at line line 280
void requireFiles( string $path, array $files)

Require in all the migration files in a given path.

Parameters

string $path
array $files

Return Value

void

at line line 330
object resolve( string $file)

Resolve a migration instance from a file.

Parameters

string $file

Return Value

object

at line line 355
array getNotes()

Get the notes for the last operation.

Return Value

array

at line line 366
Connection resolveConnection( string $connection)

Resolve the database connection instance.

Parameters

string $connection

Return Value

Connection

at line line 377
void setConnection( string $name)

Set the default connection name.

Parameters

string $name

Return Value

void

at line line 393
MigrationRepositoryInterface getRepository()

Get the migration repository instance.

at line line 403
bool repositoryExists()

Determine if the migration repository exists.

Return Value

bool

at line line 413
Filesystem getFilesystem()

Get the file system instance.

Return Value

Filesystem