Migration
abstract class Migration (View source)
Methods
void
__construct()
Migration constructor
void
up()
Up migration
void
rollback()
Rollback migration
connection(string $name)
Switch connection
string
getAdapterName()
Get adapter name
string
getTablePrefixed(string $table)
Get prefixed table name
dropIfExists(string $table, bool $displayInfo = true)
Drop table if he exists action
create(string $table, callable $cb, bool $displayInfo = true)
Function of creation of a new table in the database.
createIfNotExists(string $table, callable $cb, bool $displayInfo = true)
Create the table if not exists
renameTable(string $table, string $to, bool $displayInfo = true)
Rename table
renameTableIfExists(string $table, string $to, bool $displayInfo = true)
Rename table if exists
Details
void
__construct()
Migration constructor
abstract void
up()
Up migration
abstract void
rollback()
Rollback migration
final Migration
connection(string $name)
Switch connection
string
getAdapterName()
Get adapter name
final Migration
drop(string $table, bool $displayInfo = true)
Drop table action
final string
getTablePrefixed(string $table)
Get prefixed table name
final Migration
dropIfExists(string $table, bool $displayInfo = true)
Drop table if he exists action
final Migration
create(string $table, callable $cb, bool $displayInfo = true)
Function of creation of a new table in the database.
Migration
createIfNotExists(string $table, callable $cb, bool $displayInfo = true)
Create the table if not exists
final Migration
alter(string $table, callable $cb, bool $displayInfo = true)
Alter table action.
final Migration
addSql(string $sql)
Add SQL query
final Migration
renameTable(string $table, string $to, bool $displayInfo = true)
Rename table
final Migration
renameTableIfExists(string $table, string $to, bool $displayInfo = true)
Rename table if exists