миграция :
Код: Выделить всё
class Migration_Add_blog extends CI_Migration {
public function up()
{
$this->dbforge->add_field(array(
'id' => array(
'type' => 'INT',
'unsigned' => TRUE,
'auto_increment' => TRUE
),
'title' => array(
'type' => 'TEXT',
'null' => TRUE,
),
));
$this->dbforge->add_key('id', TRUE);
$this->dbforge->create_table('blog');
}
Код: Выделить всё
public function index()
{
$this->load->library('migration');
if (!$this->migration->version(1))
{
show_error($this->migration->error_string());
}
}
Подробнее здесь: https://stackoverflow.com/questions/654 ... -with-php8
Мобильная версия