You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which operating systems have you tested for this bug?
Windows
Which server did you use?
apache
Database
MySQL
What happened?
The 'group' parameter on $migration->latest($group) or php spark migrate -g group is being overwritten by the default database group or the $DBGroup of the Migration instance in MigrationRunner (migrate function, line 832):
$instance = new $class();
$group = $instance->getDBGroup() ?? config('Database')->defaultGroup;
Thus, making it impossible to dynamically run migrations against other/multiple database groups. In my use case, I have individual databases for each language version of my website, and I would like to run the same migrations against all of them by looping through the databases.
Steps to Reproduce
Define two databases in Database config, e.g. $default and $db2
Create a migration class without specifying $DBGroup
Create a migration controller and pass a database connection to the migration service, run migrations with db2:
PHP Version
8.0
CodeIgniter4 Version
4.1.8
CodeIgniter4 Installation Method
Composer (using
codeigniter4/appstarter
)Which operating systems have you tested for this bug?
Windows
Which server did you use?
apache
Database
MySQL
What happened?
The 'group' parameter on
$migration->latest($group)
orphp spark migrate -g group
is being overwritten by the default database group or the $DBGroup of the Migration instance in MigrationRunner (migrate function, line 832):Thus, making it impossible to dynamically run migrations against other/multiple database groups. In my use case, I have individual databases for each language version of my website, and I would like to run the same migrations against all of them by looping through the databases.
Steps to Reproduce
$default
and$db2
$DBGroup
OR run
php spark migrate -g db2
4. Check database and you'll see that the migrations were created on
$default
and not the specified$db2
.Expected Output
$db2
migrated and not$default
, so that I can dynamically set the database group without hardcoding it into the Migration class.Anything else?
No response
The text was updated successfully, but these errors were encountered: