title: Migrations Codeigniter
body: <p>As seen on "<a href="https://stackoverflow.com/questions/9154065/how-do-i-run-codeigniter-migrations#11744750">How do I run CodeIgniter migrations?</a>" I created the following migration controller:</p>
  
  <pre><code>class Migrate extends CI_Controller {
  
      public function __construct()
      {
          parent::__construct();
  
          $this-&gt;input-&gt;is_cli_request()
          or exit("Execute via command line: php index.php migrate");
  
          $this-&gt;load-&gt;library('migration');
      }
  
      public function index()
      {
          if(!$this-&gt;migration-&gt;latest())
          {
              show_error($this-&gt;migration-&gt;error_string());
          }
      }
  }
  </code></pre>
  
  <p>And the following migration script under <code>migrations/001_CreateUserTable</code>:</p>
  
  <pre><code>defined('BASEPATH') OR exit('No direct script access allowed');
  
  class Migration_CreateUserTable extends CI_Migration
  {
      private $table='user';
  
      public function up()
      {
          $this-&gt;dbforge-&gt;add_field('id INT UNSIGNED NOT NULL AUTO INCREMENT')
                      -&gt;add_field('username VARCHAR(30) NOT NULL')
                      -&gt;add_field('password VARCHAR(200) NOT NULL');
          $this-&gt;dbforge-&gt;add_key('id',true);
          $this-&gt;dbforge-&gt;create_table($this-&gt;table);
      }
  
      public function down()
      {
          $this-&gt;dbforge-&gt;drop_table($this-&gt;table);
      }
  }
  </code></pre>
  
  <p>But when I run on my command line interface:</p>
  
  <pre><code>php index.php migrate
  </code></pre>
  
  <p>I receive the following error:</p>
  
  <blockquote>
    <p>ERROR: An Error Was Encountered</p>
    
    <p>Migrations has been loaded but is disabled or set up incorrectly.</p>
  </blockquote>
  
  <p>Do you have any sort of idea hot to fix it?</p>
  
  <h1>Edit 1</h1>
  
  <p>On <code>application/config</code> I set the <code>$config['migration_enabled']=true;</code> value still no result.</p>