I want to add column that name 'accept_loc', type 'VARCHAR' to 3 database tables (use dbforge library from codeigniter) Assum they are named t1,t2,t3.
t1 structure:
- id
- bla_bla
- pick_up_loc
- ....
t2 structure:
- id
- pick_up_loc
- ....
t3 structure:
- id
- bla_bla
- pick_up_loc
- ....
if I used this code below in my migration up function:
$fields = array(
'accept_lat' => array(
'accept_loc' => 'VARCHAR',
'constraint' => '50',
'after' => 'id',
),
);
$this->dbforge->add_column('t1',$fields);
$this->dbforge->add_column('t2',$fields);
$this->dbforge->add_column('t3',$fields);
result:
t1 structure:
- id
- accept_loc
- bla_bla
- pick_up_loc
- ....
t2 structure:
- id
- accept_loc
- pick_up_loc
- ....
t3 structure:
- id
- accept_loc
- bla_bla
- pick_up_loc
- ....
it's not a good looking structure. How can I add column before 'pick_up_loc' to all of them (n database tables).
Please try to put the after in uppercase, that is 'AFTER', there was a bug in that
after
key and mentioned got fixed here.