abstract class Migration (View source)

Methods

void
__construct()

Migration constructor

void
up()

Up migration

void
rollback()

Rollback migration

connection(string $name)

Switch connection

drop(string $table)

Drop table action

dropIfExists(string $table)

Drop table if he exists action

create(string $table, callable $cb)

Function of creation of a new table in the database.

alter(string $table, callable $cb)

Alter table action.

addSql(string $sql)

Add SQL query

renameTable(string $table, string $to)

Add SQL query

string
getTablePrefixed(string $table)

Get prefixed table name

Details

void __construct()

Migration constructor

Return Value

void

abstract void up()

Up migration

Return Value

void

abstract void rollback()

Rollback migration

Return Value

void

final Migration connection(string $name)

Switch connection

Parameters

string $name

Return Value

Migration

final Migration drop(string $table)

Drop table action

Parameters

string $table

Return Value

Migration

final Migration dropIfExists(string $table)

Drop table if he exists action

Parameters

string $table

Return Value

Migration

final Migration create(string $table, callable $cb)

Function of creation of a new table in the database.

Parameters

string $table
callable $cb

Return Value

Migration

final Migration alter(string $table, callable $cb)

Alter table action.

Parameters

string $table
callable $cb

Return Value

Migration

final Migration addSql(string $sql)

Add SQL query

Parameters

string $sql

Return Value

Migration

final Migration renameTable(string $table, string $to)

Add SQL query

Parameters

string $table
string $to

Return Value

Migration

final string getTablePrefixed(string $table)

Get prefixed table name

Parameters

string $table

Return Value

string