Updater

Database updater

 class Winter\Storm\Database\Updater

Executes database migration and seed scripts based on their filename.

Properties

protected static $migrationCache : array

Local cache of migration file paths to support anonymous migrations [$path => $anonInstance || $className]

Methods

public getClassFromFile (string $file) : string | false

Extracts the namespace and class name from a file.

Parameters
Property Description
$file
string
Returns
string | false

public packDown ($file)

Packs down a migration or seed file.

Parameters
Property Description
$file
mixed
Returns
mixed

public resolve (string $file) : object | null

Resolve a migration instance from a file.

Parameters
Property Description
$file
string
Returns
object | null

public setUp ($file)

Sets up a migration or seed file.

Parameters
Property Description
$file
mixed
Returns
mixed

protected isValidScript ($object, $file)

Checks if the object is a valid update script.

Parameters
Property Description
$object
mixed
$file
mixed
Returns
mixed
Copyright © 2024 Winter CMS