This seems to be a Yii issue, but I'm adding an issue here in case that helps the fix be included in Craft sooner once it's available. (Or even perhaps be worked around in the meantime if you think that's appropriate.)
https://github.com/yiisoft/yii2/issues/18171
After updating to MySQL 8.0.21, the following is raised:
PHP Notice 'yii\base\ErrorException' with message 'Undefined index: constraint_name'
in /path/to/vendor/yiisoft/yii2/db/mysql/Schema.php:394
As I understand it, MySQL now returns the field names in uppercase, meaning the lowercase array indexes used in Yii's Schema.php don't work.
This is a temporary workaround I'm using locally for development.
I'm seeing the same thing after migrating a site to another server.
PHP Notice 'yii\base\ErrorException' with message 'Undefined index: constraint_name'
in /home/forge/galileo.123innovation.co.uk/vendor/yiisoft/yii2/db/mysql/Schema.php at line 394
Craft version: 3.4.26
PHP version: 7.2
Database driver & version: MySQL 8.0.21
Migrating an in-development Craft site to a fresh Forge provisioned server using MySQL 8 and same error. Whole site is unavailable :(
Just fixed this for the next release, which I鈥檒l get out asap, but in the meantime you can patch your local install by changing your craftcms/cms requirement in composer.json to:
"require": {
"craftcms/cms": "dev-develop as 3.4.27",
"...": "..."
}
Then run composer update.
Craft 3.4.28 is out now with this fix.
Most helpful comment
Craft 3.4.28 is out now with this fix.