The issue comes from the database creation step. The database is not being created with encoding set as `UTF8` (alias to `utf8mb3`). Which makes the initial tables created using the database default encoding `utf8mb4` instead of `utf8mb3`.
The migration you pointed then changes the default encoding, and when the table `shared_zones` is created. It tries to use `shared_zones.zone_id` (utf8mb3) to reference `zones.id` (utf8mb4) which is not compatible.
I'm using a MySQL database.
The issue comes from the database creation step. The database is not being created with encoding set as `UTF8` (alias to `utf8mb3`). Which makes the initial tables created using the database default encoding `utf8mb4` instead of `utf8mb3`.
The migration you pointed then changes the default encoding, and when the table `shared_zones` is created. It tries to use `shared_ zones.zone_ id` (utf8mb3) to reference `zones.id` (utf8mb4) which is not compatible.