abstract class Migration

Migration factory.

Implements some handy shortcuts for creating typical migrations.

Methods

static 
createTable($name, callable $definition)

Create a table.

static 
renameTable($from, $to)

Rename a table.

static 
addColumns($tableName, array $columnDefinitions)

Add columns to a table.

static 
dropColumns($tableName, array $columnDefinitions)

Drop columns from a table.

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

Rename a column.

static 
renameColumns($tableName, array $columnNames)

Rename multiple columns.

static 
addSettings(array $defaults)

Add default values for config values.

static 
addPermissions(array $permissions)

Add default permissions.

Details

static createTable($name, callable $definition)

Create a table.

Parameters

$name
callable $definition

static renameTable($from, $to)

Rename a table.

Parameters

$from
$to

static addColumns($tableName, array $columnDefinitions)

Add columns to a table.

Parameters

$tableName
array $columnDefinitions

static dropColumns($tableName, array $columnDefinitions)

Drop columns from a table.

Parameters

$tableName
array $columnDefinitions

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

Rename a column.

Parameters

$tableName
$from
$to

static renameColumns($tableName, array $columnNames)

Rename multiple columns.

Parameters

$tableName
array $columnNames

static addSettings(array $defaults)

Add default values for config values.

Parameters

array $defaults

static addPermissions(array $permissions)

Add default permissions.

Parameters

array $permissions