класс Migration_create_technologe extends CI_Migration {
public function up()
{
$this->dbforge->add_field(array(
'id' => array(
'type' => 'INT',
'constraint' => 11,
'unsigned' => TRUE,
'auto_increment' => TRUE
),
'title' => array(
'type' => 'VARCHAR',
'constraint' => '100',
'collation' => 'utf8_unicode_ci',
),
'writer' => array(
'type' => 'VARCHAR',
'constraint' => '100',
'collation' => 'utf8_unicode_ci',
),
'created' => array(
'type' => 'datetime',
'default'=> '0000-00-00 00:00:00',
'collation' => 'utf8_unicode_ci',
),
));
$this->dbforge->add_key('id',TRUE);
$this->dbforge->add_field("body longblob NOT NULL ");
$this->dbforge->create_table('technologe');
}
public function down()
{
$this->dbforge->drop_table('technologe');
}
}