Database Migration.

package Cactus
author Dave Widmer

 Methods

__construct()

__construct(string $path, Adapter $adapter) 
Inherited

inherited_from \Cactus\Task::__construct()

Parameters

$path

string

The path to the tasks folder

$adapter

\Cactus\Adapter

The adapter to connect to the data source

getAdapter()

getAdapter() : \Cactus\Adapter
Inherited

inherited_from \Cactus\Task::getAdapter()

Returns

\Cactus\AdapterThe adapter used to connect to the data source.

getPath()

getPath() : string
Inherited

inherited_from \Cactus\Task::getPath()

Returns

stringThe absolute path to the tasks directory.

Migrates a database up to a current state.

migrate(string $from) : array

Parameters

$from

string

The migration version

Returns

arrayList of debug style messages.

Rolls back a migration.

rollback(string $to) : array

Parameters

$to

string

The version to rollback to

Returns

arrayList if debug style messages

Return all of the files in the path directory.

getFiles(boolean $reverse) : array
Inherited

inherited_from \Cactus\Task::getFiles()

Parameters

$reverse

boolean

Find in reverse order?

Returns

arrayFile list

Find the given migrations.

findMigrations(string $version, array $files) : array

Parameters

$version

string

The version limit

$files

array

The files to search through

Returns

arrayList of migration files

Runs the given migrations.

runMigrations(array $migrations, string $fn) : array

Parameters

$migrations

array

The list of migrations

$fn

string

The migration function to run (up, down)

Returns

arrayAn array of output messages

 Properties

 

The adapter used for the migrations

$adapter : \Cactus\Adapter
Inherited

inherited_from \Cactus\Task::$$adapter
 

Absolute path to the tasks folder

$path : string
Inherited

inherited_from \Cactus\Task::$$path