\CI_Migration

Migration Class

All migrations should implement this, forces up() and down() and gives access to the CI super-global.

Summary

Methods
Properties
Constants
__construct()
version()
latest()
current()
error_string()
__get()
No public properties found
No constants found
find_migrations()
_get_version()
_update_version()
$_migration_enabled
$_migration_path
$_migration_version
$_error_string
N/A
No private methods found
No private properties found
N/A

Properties

$_migration_enabled

$_migration_enabled : 

Type

$_migration_path

$_migration_path : 

Type

$_migration_version

$_migration_version : 

Type

$_error_string

$_error_string : 

Type

Methods

__construct()

__construct(  $config = array()) 

Parameters

$config

version()

version(  $target_version) : mixed

Migrate to a schema version

Calls each migration step required to get to the schema version of choice

Parameters

$target_version

Returns

mixed —

TRUE if already latest, FALSE if failed, int if upgraded

latest()

latest() : mixed

Set's the schema to the latest migration

Returns

mixed —

true if already latest, false if failed, int if upgraded

current()

current() : mixed

Set's the schema to the migration version set in config

Returns

mixed —

true if already current, false if failed, int if upgraded

error_string()

error_string() : string

Error string

Returns

string —

Error message returned as a string

__get()

__get(mixed  $var) : mixed

Enable the use of CI super-global

Parameters

mixed $var

Returns

mixed

find_migrations()

find_migrations() : mixed

Set's the schema to the latest migration

Returns

mixed —

true if already latest, false if failed, int if upgraded

_get_version()

_get_version() : integer

Retrieves current schema version

Returns

integer —

Current Migration

_update_version()

_update_version(  $migrations) : boolean

Stores the current schema version

Parameters

$migrations

Returns

boolean