We should turn off automatic schema dumping (using config.active_record.dump_schema_after_migration). We don't need this on every migration in every environment; we use dumps from production for accuracy (e.g. ), which we update only occasionally.
Going forward, to get the structure.sql dump, we have to run mysqldump on one of the database servers, instead of running bundle exec rake db:structure:dump on one of the application servers.
How to test:
Check that running a migration on staging doesn't generate errors like this:
Check that bundle exec rake db:schema:dump can still generate a new version of the schema.rb dump.