CI_Migration

class CI_Migration

current()
Returns: TRUE if no migrations are found, current version string on success, FALSE on failure
Return type: mixed

Migrates up to the current version (whatever is set for $config['migration_version'] in application/config/migration.php).

error_string()
Returns: Error messages
Return type: string

This returns a string of errors that were detected while performing a migration.

find_migrations()
Returns: An array of migration files
Return type: array

An array of migration filenames are returned that are found in the migration_path property.

latest()
Returns: Current version string on success, FALSE on failure
Return type: mixed

This works much the same way as current() but instead of looking for the $config['migration_version'] the Migration class will use the very newest migration found in the filesystem.

version($target_version)
Parameters:
  • $target_version (mixed) – Migration version to process
Returns:

TRUE if no migrations are found, current version string on success, FALSE on failure

Return type:

mixed

Version can be used to roll back changes or step forwards programmatically to specific versions. It works just like current() but ignores $config['migration_version'].

$this->migration->version(5);
doc_CodeIgniter
2016-10-15 16:31:46
Comments
Leave a Comment

Please login to continue.