diff options
author | Richard Schneeman <richard.schneeman+no-recruiters@gmail.com> | 2018-08-14 10:38:31 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-14 10:38:31 -0700 |
commit | d54435b6bc3d6a2d679ca3cdd9a2a20ea2887893 (patch) | |
tree | 91a677f60203692fc65002df9639ba9cdb9c0b82 /activerecord/lib/active_record/connection_adapters/abstract | |
parent | 7fa2f539fa2a7a1ebb5086023091983ce0d810d9 (diff) | |
parent | 6b9948c85e174b77b4e4e4a904c2b6fcf1083628 (diff) | |
download | rails-d54435b6bc3d6a2d679ca3cdd9a2a20ea2887893.tar.gz rails-d54435b6bc3d6a2d679ca3cdd9a2a20ea2887893.tar.bz2 rails-d54435b6bc3d6a2d679ca3cdd9a2a20ea2887893.zip |
Merge pull request #33530 from jychen7/33515-invert-remove-foreign-key
33515 invert remove foreign key support "to_table"
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/abstract')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb index 3be0906f2a..fd9bf48ab5 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb @@ -980,11 +980,18 @@ module ActiveRecord # # remove_foreign_key :accounts, column: :owner_id # + # Removes the foreign key on +accounts.owner_id+. in a reversible manner + # + # remove_foreign_key :accounts, column: :owner_id, to_table: :owners + # # Removes the foreign key named +special_fk_name+ on the +accounts+ table. # # remove_foreign_key :accounts, name: :special_fk_name # - # The +options+ hash accepts the same keys as SchemaStatements#add_foreign_key. + # The +options+ hash accepts the same keys as SchemaStatements#add_foreign_key + # with an addition of + # [<tt>:to_table</tt>] + # The table contains the referenced primary key. def remove_foreign_key(from_table, options_or_to_table = {}) return unless supports_foreign_keys? |