· 8 years ago · May 30, 2018, 07:44 AM
1// This
2$this->DB->forge->add_column('id', 'int', 15, array(
3 'increments' => TRUE,
4 'primary_key' => TRUE)
5);
6$this->DB->forge->add_column('test', 'string', 100, array(
7 'default' => 'test')
8);
9$this->DB->forge->create_table('test', array('charset' => 'utf8'), TRUE);
10
11
12// Creates
13CREATE TABLE IF NOT EXISTS `test` (
14 `id` int(15) AUTO_INCREMENT,
15 `test` varchar(100) DEFAULT 'test',
16 PRIMARY KEY (`id`)
17)DEFAULT CHARSET=utf8;