class Migrator

Properties

protected $output

Methods

__construct(MigrationRepositoryInterface $repository, ConnectionInterface $connection, Filesystem $files)

No description

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

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

void
runMigrationList(string $path, array $migrations, Extension|null $extension = null)

No description

void
runUp(string $path, string $file, Extension|null $extension = null)

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

int
reset(string $path, Extension|null $extension = null)

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

void
runDown(string $path, string $file, Extension|null $extension = null)

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

void
runClosureMigration(array $migration, string $direction = 'up')

<p>Runs a closure migration based on the migrate direction.</p>

void
resolveAndRunClosureMigration(string $path, string $file, string $direction = 'up')

<p>Resolves and run a migration and assign the filename to the exception if needed.</p>

array
getMigrationFiles(string $path)

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

array
resolve(string $path, string $file)

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

void
installFromSchema(string $path)

<p>Initialize the Flarum database from a schema dump.</p>

setOutput(OutputInterface $output)

No description

void
note(string $message)

No description

bool
repositoryExists()

No description

Details

__construct(MigrationRepositoryInterface $repository, ConnectionInterface $connection, Filesystem $files)

Parameters

MigrationRepositoryInterface $repository
ConnectionInterface $connection
Filesystem $files

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

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

Parameters

string $path
Extension|null $extension

Return Value

void

void runMigrationList(string $path, array $migrations, Extension|null $extension = null)

Parameters

string $path
array $migrations
Extension|null $extension

Return Value

void

protected void runUp(string $path, string $file, Extension|null $extension = null)

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

Parameters

string $path
string $file
Extension|null $extension

Return Value

void

int reset(string $path, Extension|null $extension = null)

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

Parameters

string $path
Extension|null $extension

Return Value

int

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

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

Parameters

string $path
string $file
Extension|null $extension

Return Value

void

protected void runClosureMigration(array $migration, string $direction = 'up')

<p>Runs a closure migration based on the migrate direction.</p>

Parameters

array $migration
string $direction

Return Value

void

Exceptions

MigrationKeyMissing

protected void resolveAndRunClosureMigration(string $path, string $file, string $direction = 'up')

<p>Resolves and run a migration and assign the filename to the exception if needed.</p>

Parameters

string $path
string $file
string $direction

Return Value

void

Exceptions

FileNotFoundException

array getMigrationFiles(string $path)

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

Parameters

string $path

Return Value

array

array resolve(string $path, string $file)

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

Parameters

string $path
string $file

Return Value

array

Exceptions

RuntimeException

void installFromSchema(string $path)

<p>Initialize the Flarum database from a schema dump.</p>

Parameters

string $path <p>to the directory containing the dump.</p>

Return Value

void

Migrator setOutput(OutputInterface $output)

Parameters

OutputInterface $output

Return Value

Migrator

protected void note(string $message)

Parameters

string $message

Return Value

void

bool repositoryExists()

Return Value

bool