How can i add index to any field in database using codeigniter migration.? I have tried with alter query but i didn't find array key for indexing to pass in alter query?
$fields = array('photo_id' =>
array('type' => 'INT',
'constraint'=>11,
'after'=>'photo_req_id',`enter code here`
'null'=>false));
And i also try to find on codeigniter documentation but not mention anything about indexing. Guys please help to set indexing by using codeigniter migration method.
Indexing is done by using the
add_key
function documented here.To create a PRIMARY KEY index on
photo_id
To create a secondary index on
photo_id