-
Notifications
You must be signed in to change notification settings - Fork 0
CI_Migration
Migration Class
All migrations should implement this, forces up() and down() and gives access to the CI super-global.
- Class name: CI_Migration
- Namespace:
protected boolean $_migration_enabled = FALSE
Whether the library is enabled
- Visibility: protected
protected boolean $_migration_type = 'sequential'
Migration numbering type
- Visibility: protected
protected string $_migration_path = NULL
Path to migration classes
- Visibility: protected
protected mixed $_migration_version
Current migration version
- Visibility: protected
protected string $_migration_table = 'migrations'
Database table with migration info
- Visibility: protected
protected boolean $_migration_auto_latest = FALSE
Whether to automatically run migrations
- Visibility: protected
protected boolean $_migration_regex = NULL
Migration basename regex
- Visibility: protected
protected string $_error_string = ''
Error message
- Visibility: protected
void CI_Migration::__construct(array $config)
Initialize Migration Class
- Visibility: public
- $config array
mixed CI_Migration::version(string $target_version)
Migrate to a schema version
Calls each migration step required to get to the schema version of choice
- Visibility: public
- $target_version string - <p>Target schema version</p>
mixed CI_Migration::latest()
Sets the schema to the latest migration
- Visibility: public
mixed CI_Migration::current()
Sets the schema to the migration version set in config
- Visibility: public
string CI_Migration::error_string()
Error string
- Visibility: public
array CI_Migration::find_migrations()
Retrieves list of available migration scripts
- Visibility: public
string CI_Migration::_get_migration_number(string $migration)
Extracts the migration number from a filename
- Visibility: protected
- $migration string
string CI_Migration::_get_migration_name(string $migration)
Extracts the migration class name from a filename
- Visibility: protected
- $migration string
string CI_Migration::_get_version()
Retrieves current schema version
- Visibility: protected
void CI_Migration::_update_version(string $migration)
Stores the current schema version
- Visibility: protected
- $migration string - <p>Migration reached</p>
mixed CI_Migration::__get(string $var)
Enable the use of CI super-global
- Visibility: public
- $var string