abstract class Migration

Migration factory.

Implements some handy shortcuts for creating typical migrations.

Methods

static 
createTable($name, callable $definition)

<p>Create a table.</p>

static 
renameTable($from, $to)

<p>Rename a table.</p>

static 
addColumns($tableName, array $columnDefinitions)

<p>Add columns to a table.</p>

static 
dropColumns($tableName, array $columnDefinitions)

<p>Drop columns from a table.</p>

static 
renameColumn($tableName, $from, $to)

<p>Rename a column.</p>

static 
renameColumns($tableName, array $columnNames)

<p>Rename multiple columns.</p>

static 
addSettings(array $defaults)

<p>Add default values for config values.</p>

static 
addPermissions(array $permissions)

<p>Add default permissions.</p>

Details

static createTable($name, callable $definition)

<p>Create a table.</p>

Parameters

$name
callable $definition

static renameTable($from, $to)

<p>Rename a table.</p>

Parameters

$from
$to

static addColumns($tableName, array $columnDefinitions)

<p>Add columns to a table.</p>

Parameters

$tableName
array $columnDefinitions

static dropColumns($tableName, array $columnDefinitions)

<p>Drop columns from a table.</p>

Parameters

$tableName
array $columnDefinitions

static renameColumn($tableName, $from, $to)

<p>Rename a column.</p>

Parameters

$tableName
$from
$to

static renameColumns($tableName, array $columnNames)

<p>Rename multiple columns.</p>

Parameters

$tableName
array $columnNames

static addSettings(array $defaults)

<p>Add default values for config values.</p>

Parameters

array $defaults

static addPermissions(array $permissions)

<p>Add default permissions.</p>

Parameters

array $permissions