有没有好的工具来管理对MySQL模式的更改?可以是独立的,也可以与CodeIgniter框架集成。我是根据使用CakePHP的DB迁移工具的经验提出这个想法的,所以类似的工具就更好了。
发布于 2011-07-14 11:24:46
在其他信条项目中,有一个Doctrine migrations项目。
发布于 2015-06-17 09:56:23
defined('BASEPATH') OR exit('No direct script access allowed');
class Migration_Add_blog extends CI_Migration {
public function up()
{
$this->dbforge->add_field(array(
'blog_id' => array(
'type' => 'INT',
'constraint' => 5,
'unsigned' => TRUE,
'auto_increment' => TRUE
),
'blog_title' => array(
'type' => 'VARCHAR',
'constraint' => '100',
),
'blog_description' => array(
'type' => 'TEXT',
'null' => TRUE,
),
));
$this->dbforge->create_table('blog');
}
public function down()
{
$this->dbforge->drop_table('blog');
}从http://www.codeigniter.com/userguide2/libraries/migration.html查看
https://stackoverflow.com/questions/6686500
复制相似问题