PHP Class TI_Migration, TastyIgniter

Inheritance: extends CI_Migration
Show file Open project: tastyigniter/tastyigniter

Public Methods

Method Description
__construct ( $config = [] )
current ( string $type = '' ) : mixed Sets the schema to the migration version set in config for a given migration type
find_migrations ( string $type = '' ) : array Retrieves list of available migration scripts for a given migration type
get_available_version ( ) : string Retrieves current available migration version
get_latest_version ( string $type = '' ) : string Retrieves latest migration version for a given migration type
get_migration_number ( string $migration ) : string Extracts the migration number from a filename
get_migrations_path ( string $type = '' ) : string Retrieves the migrations path for a given migration type
get_version ( string $type = '' ) : string Retrieves current schema version for a given migration type
install ( ) : mixed Install TastyIgniter core schema to the migration version set in config.
latest ( string $type = '' ) : mixed Sets the schema to the latest migration for a given migration type
version ( string $target_version, string $type = '' ) : mixed Migrate to a schema version for a given migration type

Protected Methods

Method Description
_get_version ( string $type = '' ) : string Retrieves current schema version for a given migration type
_update_version ( string $migration, string $type = '' ) Stores the current schema version for a given migration type

Method Details

__construct() public method

public __construct ( $config = [] )

_get_version() protected method

Retrieves current schema version for a given migration type
protected _get_version ( string $type = '' ) : string
$type string
return string Current migration version

_update_version() protected method

Stores the current schema version for a given migration type
protected _update_version ( string $migration, string $type = '' )
$migration string Migration reached
$type string

current() public method

Sets the schema to the migration version set in config for a given migration type
public current ( string $type = '' ) : mixed
$type string
return mixed TRUE if already current, FALSE if failed, string if upgraded

find_migrations() public method

Retrieves list of available migration scripts for a given migration type
public find_migrations ( string $type = '' ) : array
$type string
return array list of migration file paths sorted by version

get_available_version() public method

Retrieves current available migration version
public get_available_version ( ) : string
return string Current migration version

get_latest_version() public method

Retrieves latest migration version for a given migration type
public get_latest_version ( string $type = '' ) : string
$type string
return string Latest migration version

get_migration_number() public method

Extracts the migration number from a filename
public get_migration_number ( string $migration ) : string
$migration string
return string Numeric portion of a migration filename

get_migrations_path() public method

Retrieves the migrations path for a given migration type
public get_migrations_path ( string $type = '' ) : string
$type string
return string migration path

get_version() public method

Retrieves current schema version for a given migration type
public get_version ( string $type = '' ) : string
$type string
return string Current migration version

install() public method

Install TastyIgniter core schema to the migration version set in config.
public install ( ) : mixed
return mixed TRUE installed, FALSE if failed

latest() public method

Sets the schema to the latest migration for a given migration type
public latest ( string $type = '' ) : mixed
$type string
return mixed TRUE if already latest, FALSE if failed, string if upgraded

version() public method

Calls each migration step required to get to the schema version of choice
public version ( string $target_version, string $type = '' ) : mixed
$target_version string Target schema version
$type string
return mixed TRUE if already latest, FALSE if failed, string if upgraded