class Migrator

Properties

protected MigrationRepositoryInterface $repository <p>The migration repository implementation.</p>
protected Filesystem $files <p>The filesystem instance.</p>
protected ConnectionResolverInterface $resolver <p>The connection resolver instance.</p>
protected string $connection <p>The name of the default connection.</p>
protected array $notes <p>The notes for the current operation.</p>

Methods

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

<p>Create a new migrator instance.</p>

void
run(string $path, string $extension = null)

<p>Run the outstanding migrations at a given path.</p>

void
runMigrationList(array $migrations, $extension)

<p>Run an array of migrations.</p>

void
runUp(string $file, string $extension)

<p>Run &quot;up&quot; a migration instance.</p>

int
reset($path, $extension = null)

<p>Rolls all of the currently applied migrations back.</p>

void
runDown(string $file, string $extension = null)

<p>Run &quot;down&quot; a migration instance.</p>

array
getMigrationFiles(string $path)

<p>Get all of the migration files in a given path.</p>

void
requireFiles(string $path, array $files)

<p>Require in all the migration files in a given path.</p>

object
resolve(string $file, $extension = null)

<p>Resolve a migration instance from a file.</p>

void
note(string $message)

<p>Raise a note event for the migrator.</p>

array
getNotes()

<p>Get the notes for the last operation.</p>

Connection
resolveConnection(string $connection)

<p>Resolve the database connection instance.</p>

void
setConnection(string $name)

<p>Set the default connection name.</p>

MigrationRepositoryInterface
getRepository()

<p>Get the migration repository instance.</p>

bool
repositoryExists()

<p>Determine if the migration repository exists.</p>

Filesystem
getFilesystem()

<p>Get the file system instance.</p>

Details

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

<p>Create a new migrator instance.</p>

Parameters

MigrationRepositoryInterface $repository
ConnectionResolverInterface $resolver
Filesystem $files

Return Value

void

void run(string $path, string $extension = null)

<p>Run the outstanding migrations at a given path.</p>

Parameters

string $path
string $extension

Return Value

void

void runMigrationList(array $migrations, $extension)

<p>Run an array of migrations.</p>

Parameters

array $migrations
$extension

Return Value

void

protected void runUp(string $file, string $extension)

<p>Run &quot;up&quot; a migration instance.</p>

Parameters

string $file
string $extension

Return Value

void

int reset($path, $extension = null)

<p>Rolls all of the currently applied migrations back.</p>

Parameters

$path
$extension

Return Value

int

protected void runDown(string $file, string $extension = null)

<p>Run &quot;down&quot; a migration instance.</p>

Parameters

string $file
string $extension

Return Value

void

array getMigrationFiles(string $path)

<p>Get all of the migration files in a given path.</p>

Parameters

string $path

Return Value

array

void requireFiles(string $path, array $files)

<p>Require in all the migration files in a given path.</p>

Parameters

string $path
array $files

Return Value

void

object resolve(string $file, $extension = null)

<p>Resolve a migration instance from a file.</p>

Parameters

string $file
$extension

Return Value

object

protected void note(string $message)

<p>Raise a note event for the migrator.</p>

Parameters

string $message

Return Value

void

array getNotes()

<p>Get the notes for the last operation.</p>

Return Value

array

Connection resolveConnection(string $connection)

<p>Resolve the database connection instance.</p>

Parameters

string $connection

Return Value

Connection

void setConnection(string $name)

<p>Set the default connection name.</p>

Parameters

string $name

Return Value

void

MigrationRepositoryInterface getRepository()

<p>Get the migration repository instance.</p>

Return Value

MigrationRepositoryInterface

bool repositoryExists()

<p>Determine if the migration repository exists.</p>

Return Value

bool

Filesystem getFilesystem()

<p>Get the file system instance.</p>

Return Value

Filesystem