Class: ActiveRecord::ConnectionAdapters::Rails81DepartureAdapter::SchemaCreation
- Inherits:
-
MySQL::SchemaCreation
- Object
- MySQL::SchemaCreation
- ActiveRecord::ConnectionAdapters::Rails81DepartureAdapter::SchemaCreation
- Defined in:
- lib/active_record/connection_adapters/rails_8_1_departure_adapter.rb
Overview
github.com/departurerb/departure/commit/f178ca26cd3befa1c68301d3b57810f8cdcff9eb For ‘DROP FOREIGN KEY constraint_name` with pt-online-schema-change requires specifying `_constraint_name` rather than the real constraint_name due to to a limitation in MySQL pt-online-schema-change adds a leading underscore to foreign key constraint names when creating the new table. www.percona.com/blog/2017/03/21/dropping-foreign-key-constraint-using-pt-online-schema-change-2/
Instance Method Summary collapse
-
#visit_DropForeignKey(name) ⇒ Object
rubocop:disable Naming/MethodName.
Instance Method Details
#visit_DropForeignKey(name) ⇒ Object
rubocop:disable Naming/MethodName
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/active_record/connection_adapters/rails_8_1_departure_adapter.rb', line 24 def visit_DropForeignKey(name) # rubocop:disable Naming/MethodName fk_name = if name =~ /^__(.+)/ Regexp.last_match(1) else "_#{name}" end "DROP FOREIGN KEY #{fk_name}" end |