我的迁移 add_column
class Migration_Add_post_to_post extends CI_Migration {
public function up() {
$fields = array(
'post' => array('type' => 'TEXT')
);
$this->dbforge->add_column('posts', $fields);
}
public function down() {
$this->dbforge->drop_column('posts', 'post');
}
}
Codeigniter 在代码执行时抛出数据库错误
ERROR: syntax error at or near "Array" LINE 1: ALTER TABLE "posts" ADD Array NOT NULL ^
我在 github https://github.com/EllisLab/CodeIgniter/issues/808上发现了这个问题。即使问题已关闭,但似乎除了 mysql 驱动程序之外该错误仍然存在。
有什么办法可以解决这个问题吗?