\Pop\Db\SqlMigrator

Sql migrator class

Summary

Methods
Properties
Constants
__construct()
getDb()
db()
create()
run()
runAll()
rollback()
rollbackAll()
setPath()
getPath()
getCurrent()
No public properties found
No constants found
No protected methods found
$db
$path
$current
$migrations
N/A
No private methods found
No private properties found
N/A

Properties

$path

$path : string

Migration path

Type

string

$current

$current : string

Current migration position

Type

string

$migrations

$migrations : array

Migrations

Type

array

Methods

__construct()

__construct(\Pop\Db\Adapter\AbstractAdapter  $db, string  $path) 

Constructor

Instantiate the migrator object

Parameters

\Pop\Db\Adapter\AbstractAdapter $db
string $path

create()

create(string  $class, string  $path = null) : string

Create new migration file

Parameters

string $class
string $path

Throws

\Pop\Db\Sql\Exception

Returns

string

run()

run(mixed  $steps = 1) : \Pop\Db\Sql\Migrator

Run the migrator (up/forward direction)

Parameters

mixed $steps

Returns

\Pop\Db\Sql\Migrator

runAll()

runAll() : \Pop\Db\Sql\Migrator

Run all the migrator (up/forward direction)

Returns

\Pop\Db\Sql\Migrator

rollback()

rollback(mixed  $steps = 1) : \Pop\Db\Sql\Migrator

Roll back the migrator (down/backward direction)

Parameters

mixed $steps

Returns

\Pop\Db\Sql\Migrator

rollbackAll()

rollbackAll() : \Pop\Db\Sql\Migrator

Roll back all the migrator (down/backward direction)

Returns

\Pop\Db\Sql\Migrator

setPath()

setPath(string  $path) : \Pop\Db\Sql\Migrator

Set the migration path and get migration files

Parameters

string $path

Throws

\Pop\Db\Sql\Exception

Returns

\Pop\Db\Sql\Migrator

getPath()

getPath() : string

Get the migration path

Returns

string

getCurrent()

getCurrent() : string

Get the migration path

Returns

string