Fix undefined format_options method in SchemaDumper for MySQL db
What does this MR do?
Fixes invalid db/schema.rb
generation for MySQL:
# Could not dump table "application_settings" because of following NoMethodError
# undefined method `format_options' for #<ActiveRecord::SchemaDumper:0x00007fdca8b9ead8>
# Could not dump table "audit_events" because of following NoMethodError
# undefined method `format_options' for #<ActiveRecord::SchemaDumper:0x00007fdca8b9ead8>
# Could not dump table "award_emoji" because of following NoMethodError
# undefined method `format_options' for #<ActiveRecord::SchemaDumper:0x00007fdca8b9ead8>
# Could not dump table "badges" because of following NoMethodError
# undefined method `format_options' for #<ActiveRecord::SchemaDumper:0x00007fdca8b9ead8>
# Could not dump table "boards" because of following NoMethodError
# undefined method `format_options' for #<ActiveRecord::SchemaDumper:0x00007fdca8b9ead8>
# Could not dump table "broadcast_messages" because of following NoMethodError
# undefined method `format_options' for #<ActiveRecord::SchemaDumper:0x00007fdca8b9ead8>
The problem appeared after we updated our opclasses support with Rails 5 code in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/21416. There is no format_options
method in https://github.com/rails/rails/blob/4-2-stable/activerecord/lib/active_record/schema_dumper.rb. For some reason it fails only in MySQL ¯_(ツ)_/¯
What are the relevant issue numbers?
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
Tests added for this feature/bug -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides
Edited by Dmytro Zaporozhets (DZ)