Welcome Guest, Not a member yet? Register   Sign In
Database Forge Class - COLLATE attribute
#1

is it possible using DBforge - make a new field with 'COLLATE' => 'utf8_bin',?
Reply
#2

It should be. Have you tried this?

PHP Code:
$fields =[
 
   'field_name' => [
 
        'type' => 'TEXT',
 
        'COLLATE' => 'utf8_bin',
 
     ],
];
$this->dbforge->add_column('table_name'$fields); 

If your table has defined a COLLATE option then that will be used automatically for new fields. Also, keep in mind that $this->dbforge->create_table(... will use the value of 'dbcollat' found in config/database.php. Same is true for 'char_set'.
Reply
#3

It is not working.
I managed to make this only this way
$this->dbforge->add_field("`password` CHAR(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL");
Reply




Theme © iAndrew 2016 - Forum software by © MyBB