CodeIgniter Forums
add UNIQUE KEY in any column - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forum-6.html)
+--- Forum: Issues (https://forum.codeigniter.com/forum-19.html)
+--- Thread: add UNIQUE KEY in any column (/thread-61561.html)



add UNIQUE KEY in any column - rejoan - 04-26-2015

Hi,
How can i add a unique key to a column? $this->dbforge->add_key() only able to do add primary key. I there are any way to add unique, full-text etc key?

Thanks


RE: add UNIQUE KEY in any column - rejoan - 04-26-2015

Got it,

$fields = array(
'email' => array(
'auto_increment' => TRUE,
'unique' => TRUE
),
.....