CodeIgniter Forums
add_column not working in codeigniter 3.1.3 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forum-6.html)
+--- Forum: CodeIgniter 2.x (https://forum.codeigniter.com/forum-18.html)
+--- Thread: add_column not working in codeigniter 3.1.3 (/thread-67217.html)



add_column not working in codeigniter 3.1.3 - Ajith Sasidharan - 01-27-2017

Hi All, 

Iam trying to add a new column using the following code, but it is not working. Thanks in advance...

<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Migration_Add_age_patient extends CI_Migration {

  public function up(){
  $this->dbforge->add_column('patientmedicalprofile', array(
                'age' => array(
                    'type' => 'INT',
                    'constraint' => 11,
                    'default' => '',
                    'after' => 'birthday',
                    'null' => TRUE,
                )
            ));
 

  }

  public function down(){

  }
}