I'm trying to set up a controller for running migrations, and - if necessary - rolling them back.
In the migrations config I have these settings:
PHP Code:
$config['migration_enabled'] = TRUE;
$config['migration_type'] = 'timestamp';
$config['migration_table'] = 'migrations';
$config['migration_auto_latest'] = FALSE;
$config['migration_version'] = '20170826141700'; //this is the first migration I need to run
$config['migration_path'] = APPPATH.'migrations/';
I have a file named "20170826141700_create_eventlog_table.php" in application/migrations.
This file has a class named "Migration_Create_eventlog_table" with 2 functions: up() and down().
The up function creates a table ('eventlog') in my database.
The down function drops this table.
If I run $this->migration->latest(), it returns TRUE.
The eventlog table is created succesfully. So far, so good.
However, the migrations table remains empty. The version number of the latest migration isn't saved.
As a result of this, I can't rollback this migration.
How can I get this working?