Welcome Guest, Not a member yet? Register   Sign In
change database connection of codeigniter migration
#1

[eluser]Unknown[/eluser]
Dear i would like to change database connection of codeigniter migration.
My default database is DB1 in MYSQL, But I want to change connection to DB2 in MYSQL.

How can i do that? default coding as the following .

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');
}

How to change connection to DB2 in MYSQL?

Best regards,




Theme © iAndrew 2016 - Forum software by © MyBB