[2022-09-16 14:05:19+0000] rake aborted! [2022-09-16 14:05:19+0000] Sequel::DatabaseError: Mysql2::Error: Referencing column 'app_guid' and referenced column 'guid' in foreign key constraint 'route_mappings_ibfk_1' are incompatible. [2022-09-16 14:05:19+0000] Caused by: [2022-09-16 14:05:19+0000] Mysql2::Error: Referencing column 'app_guid' and referenced column 'guid' in foreign key constraint 'route_mappings_ibfk_1' are incompatible. [2022-09-16 14:05:19+0000] Tasks: TOP => db:migrate [2022-09-16 14:05:19+0000] (See full trace by running task with --trace)
This is an issue specific to MySQL 8.0.30 being used as a TAS external database. The resolution will be included in TAS 3.0 and backported to TAS 2.13. The change is a one line change to the "/var/vcap/packages/cloud_controller_ng/cloud_controller_ng/db/migrations/20150514190458_fix_mysql_collations.rb" migration script on the cloud_controllers. This change can be made manually to the script on the cloud controller instance to resolve the issue and enable successful TAS database migration to the 2.13 schema. When making this change, no other changes should be made in this directory. The change is shown at:
It really only needs to be changed on the "Bootstrap" cloud_controller instance. To determine this, a command like the following can be run.
bosh -d `bosh ds --column=name | grep ^cf-` instances -i --column=Instance --column=Bootstrap | grep -w cloud_controller
Once this change has been made, drop and recreate the "ccdb" database/schema in the external MySQL 8 database, then run the Apply Changes.
While this change to the "20150514190458_fix_mysql_collations.rb" migration script will not survive a recreate of the cloud_controller instance, the database will have already been migrated so will not be needed again unless another new ccdb database/schema is created in the future.