-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: can't run migrations when CI_ENVIRONMENT = testing #4033
Comments
Run if (is_cli() && ! (ENVIRONMENT === 'testing'))
{
$this->request = Services::clirequest($this->config);
}
else
{
$this->request = Services::request($this->config);
// guess at protocol if needed
$this->request->setProtocolVersion($_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.1');
} |
I have confirmed the behavior. dotenv:
dotenv:
|
@iRedds How can we create table |
@kenjis, are you getting an error when CI_ENVIRONMENT = development?
The easiest way is to set the test database in database.default before migrating. =) |
@iRedds Yes, I use the dev branch.
Very tricky. I can't bear! |
@kaleidoscopique please see #3309 for the explanation. You do not set the |
@kenjis a little side note. it seems you are using the dev branch but your debig backtrace is not yet updated. Since v4.0.4 there are many additions/ changes to Shameless plug: You can try this library of mine to do the update automatically. 😁 |
Describe the bug
Impossible to run
php spark migrate
whenCI_ENVIRONMENT = testing
.CodeIgniter 4 version
4.0.4 - stable
Affected module(s)
spark migrate
and \App\Controllers\Cimigrate::indexExpected behavior, and steps to reproduce if appropriate
CI_ENVIRONMENT = development
)php spark session:migration
)CI_ENVIRONMENT = testing
in dotenv file.php spark migrate
and this error happens:And it works like a charm when you replace
CI_ENVIRONMENT = testing
toCI_ENVIRONMENT = development
.This guy had the same issue in February 2020 : https://forum.codeigniter.com/thread-75608.html
Context
The text was updated successfully, but these errors were encountered: