PHP Class RainLab\Builder\Classes\MigrationModel

Author: Alexey Bobkov, Samuel Georges
Inheritance: extends RainLab\Builder\Classes\BaseModel
Show file Open project: rainlab/builder-plugin Class Usage Examples

Public Properties

Property Type Description
$code The migration PHP code string
$description The migration description
$originalScriptFileName
$scriptFileName The migration script file name. Currently only migrations with a single (or none) script file are supported by Builder editors.
$version Migration version string

Protected Properties

Property Type Description
$fillable
$originalVersion
$validationRules

Public Methods

Method Description
apply ( )
deleteModel ( )
getNextVersion ( )
initVersion ( $versionType )
isApplied ( )
load ( $versionNumber )
makeScriptFileNameUnique ( )
rollback ( )
save ( $executeOnSave = true ) Saves the migration and applies all outstanding migrations for the plugin.
validate ( )

Protected Methods

Method Description
assignFileName ( )
deleteVersion ( )
getOriginalFileContents ( )
getPluginUpdatesPath ( $fileName = null )
getPluginVersionInformation ( )
insertOrUpdateVersion ( )
loadScriptFile ( )
removeScriptFile ( )
rollbackSaving ( $originalVersionData, $originalScriptFileContents )
rollbackScriptFile ( $fileContents )
rollbackVersionFile ( $fileData )
saveScriptFile ( )

Method Details

apply() public method

public apply ( )

assignFileName() protected method

protected assignFileName ( )

deleteModel() public method

public deleteModel ( )

deleteVersion() protected method

protected deleteVersion ( )

getNextVersion() public method

public getNextVersion ( )

getOriginalFileContents() protected method

protected getOriginalFileContents ( )

getPluginUpdatesPath() protected method

protected getPluginUpdatesPath ( $fileName = null )

getPluginVersionInformation() protected method

initVersion() public method

public initVersion ( $versionType )

insertOrUpdateVersion() protected method

protected insertOrUpdateVersion ( )

isApplied() public method

public isApplied ( )

load() public method

public load ( $versionNumber )

loadScriptFile() protected method

protected loadScriptFile ( )

makeScriptFileNameUnique() public method

removeScriptFile() protected method

protected removeScriptFile ( )

rollback() public method

public rollback ( )

rollbackSaving() protected method

protected rollbackSaving ( $originalVersionData, $originalScriptFileContents )

rollbackScriptFile() protected method

protected rollbackScriptFile ( $fileContents )

rollbackVersionFile() protected method

protected rollbackVersionFile ( $fileData )

save() public method

Saves the migration and applies all outstanding migrations for the plugin.
public save ( $executeOnSave = true )

saveScriptFile() protected method

protected saveScriptFile ( )

validate() public method

public validate ( )

Property Details

$code public property

The migration PHP code string
public $code

$description public property

The migration description
public $description

$fillable protected static property

protected static $fillable

$originalScriptFileName public property

public $originalScriptFileName

$originalVersion protected property

protected $originalVersion

$scriptFileName public property

The migration script file name. Currently only migrations with a single (or none) script file are supported by Builder editors.
public $scriptFileName

$validationRules protected property

protected $validationRules

$version public property

Migration version string
public $version