Hi,
I have some DBgroups declared in App/Config/Database:
// localhost
public $ywl_config = [
'DSN' => '',
'hostname' => 'localhost',
'username' => 'yachtworklist',
'password' => 'REDACTED',
'database' => 'ywl_config',
'DBDriver' => 'MySQLi',
'DBPrefix' => '',
'pConnect' => false,
'DBDebug' => (ENVIRONMENT !== 'production'),
'cacheOn' => false,
'cacheDir' => '',
'charset' => 'utf8',
'DBCollat' => 'utf8_general_ci',
'swapPre' => '',
'encrypt' => false,
'compress' => false,
'strictOn' => false,
'failover' => [],
'port' => 3306,
];
public $ywl_data = [
'DSN' => '',
'hostname' => 'localhost',
'username' => 'yachtworklist',
'password' => 'REDACTED',
'database' => 'ywl_data',
'DBDriver' => 'MySQLi',
'DBPrefix' => '',
'pConnect' => false,
'DBDebug' => (ENVIRONMENT !== 'production'),
'cacheOn' => false,
'cacheDir' => '',
'charset' => 'utf8',
'DBCollat' => 'utf8_general_ci',
'swapPre' => '',
'encrypt' => false,
'compress' => false,
'strictOn' => false,
'failover' => [],
'port' => 3306,
];
and I want that each migration file call their DataBase, but all of migrations files call DataBase defined in $defaultGroup
class BoatDecks extends Migration
{
protected $DBGroup = 'ywl_data'; // doesn't work!!!!
public function up()
{
$this->forge->addField([
'id' => [
'type' => 'SERIAL'
],
'id_boat' => [
'type' => 'INT',
'constraint' => '4'
],
'deck_name' => [
'type' => 'VARCHAR',
'constraint' => '25'
]
]);
$this->forge->addField("created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP()");
$this->forge->addField("updated_at TIMESTAMP NULL");
$this->forge->addField("deleted_at TIMESTAMP NULL");
$this->forge->addKey('id', TRUE);
$this->forge->createTable('ywl_data_boat_decks');
}
//--------------------------------------------------------------------
public function down()
{
$this->forge->dropTable('ywl_data_boat_decks');
}
}
thank's!