Class CI_Migration - echiong/testRepo GitHub Wiki

##Class CI_Migration

Migration Class

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

Package: [[CodeIgniter<a href="Package CodeIgniter.Libraries.md">Libraries]]
Category: Libraries
Author: Reactor Engineers
Link
Located at system/libraries/Migration.php

##Methods summary


public __construct ( mixed $config = array() )


public mixed version ( mixed $target_version )

Migrate to a schema version

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

Parameters

$target_version mixed
$version integer Target schema version

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


public mixed latest ( )

Set's the schema to the latest migration

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


public mixed current ( )

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

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


public string error_string ( )

Error string

Returns string
Error message returned as a string


protected mixed find_migrations ( )

Set's the schema to the latest migration

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


protected integer _get_version ( )

Retrieves current schema version

Returns integer
Current Migration


protected _update_version ( mixed $migrations )

Stores the current schema version

Parameters

$migrations mixed
$migrations integer Migration reached

Returns
Outputs a report of the migration


public mixed __get ( mixed $var )

Enable the use of CI super-global

Parameters

$var mixed
$var

Returns mixed

<table class="summary" id="properties">
<caption>Properties summary</caption>
<tr data-order="_migration_enabled" id="$_migration_enabled">
	<td class="attributes"><code>
		protected  
		boolean
	</code></td>

	<td class="name">

$_migration_enabled

FALSE
#
		<div class="description detailed">
			

		</div>
	</div></td>
</tr>
<tr data-order="_migration_path" id="$_migration_path">
	<td class="attributes"><code>
		protected  
		mixed
	</code></td>

	<td class="name">

$_migration_path

NULL
#
		<div class="description detailed">
			

		</div>
	</div></td>
</tr>
<tr data-order="_migration_version" id="$_migration_version">
	<td class="attributes"><code>
		protected  
		integer
	</code></td>

	<td class="name">

$_migration_version

0
#
		<div class="description detailed">
			

		</div>
	</div></td>
</tr>
<tr data-order="_error_string" id="$_error_string">
	<td class="attributes"><code>
		protected  
		string
	</code></td>

	<td class="name">

$_error_string

''
#
		<div class="description detailed">
			

		</div>
	</div></td>
</tr>
</table>
⚠️ **GitHub.com Fallback** ⚠️