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
php artisan migrate fails on MySQL when running the new Component Monitoring migration (2025_09_14_000000_create_component_checks_table.php, added in #211). The foreign key column component_checks.component_id is created as BIGINT UNSIGNED (via foreignId()), but the referenced components.id is INT UNSIGNED (created long ago via increments('id')). MySQL 8.0.16+/9.x strictly requires matching integer types for foreign keys and rejects this with error 3780. The mismatch is invisible on SQLite, which doesn't enforce FK column-type compatibility.
foreignId() produces BIGINT UNSIGNED, while components.id remains INT UNSIGNED. MySQL requires the FK column and the referenced column to be the same integer type/size, so the constraint creation fails. This appears to be masked when running against SQLite, which does not enforce FK column-type compatibility.
Summary
php artisan migratefails on MySQL when running the new Component Monitoring migration (2025_09_14_000000_create_component_checks_table.php, added in #211). The foreign key columncomponent_checks.component_idis created asBIGINT UNSIGNED(viaforeignId()), but the referencedcomponents.idisINT UNSIGNED(created long ago viaincrements('id')). MySQL 8.0.16+/9.x strictly requires matching integer types for foreign keys and rejects this with error 3780. The mismatch is invisible on SQLite, which doesn't enforce FK column-type compatibility.Environment
dev-main(reproduced withcomponent_checksmigration as of Component Monitoring #211; still present after Advanced Component Group Ordering #212)composer install+php artisan migrate)Steps to reproduce
.envwithDB_CONNECTION=mysqlagainst a MySQL 8.0.16+ / 9.x server.php artisan migrate(orphp artisan migrate:fresh).2025_09_14_000000_create_component_checks_table.php.Actual error
Root cause
database/migrations/2015_01_05_201444_CreateComponentsTable.php:database/migrations/2025_09_14_000000_create_component_checks_table.php:foreignId()producesBIGINT UNSIGNED, whilecomponents.idremainsINT UNSIGNED. MySQL requires the FK column and the referenced column to be the same integer type/size, so the constraint creation fails. This appears to be masked when running against SQLite, which does not enforce FK column-type compatibility.