title: How to seed data in codeigniter
body: <p>How to seed data in CodeIgniter after migrating?
  I want to seed some pre-define users after the migration of table user once the migration completed.</p>
  
  <pre><code>defined('BASEPATH') OR exit('No direct script access allowed');
  
  class Migration_Users extends CI_Migration {
  
      public function up()
      {
          $this-&gt;load-&gt;database();
          $dbprefix = $this-&gt;db-&gt;dbprefix;
          $this-&gt;dbforge-&gt;add_field(array(
                  'id' =&gt; array(
                          'type' =&gt; 'INT',
                          'constraint' =&gt;11,
                          'unsigned' =&gt; TRUE,
                          'auto_increment' =&gt; TRUE
                  ),
                  'first_name' =&gt; array(
                          'type' =&gt; 'VARCHAR',
                          'constraint' =&gt; 50
                  ),
                  'last_name' =&gt; array(
                          'type' =&gt; 'VARCHAR',
                          'constraint' =&gt; 50,
                  )
               ));
         $this-&gt;dbforge-&gt;add_key('id', TRUE);
          $this-&gt;dbforge-&gt;create_table('users');
        }
  
      public function down()
      {
              $this-&gt;dbforge-&gt;drop_table('users');
      }
   }
  </code></pre>