aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/CHANGELOG.md
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2015-02-11 11:09:29 +0100
committerYves Senn <yves.senn@gmail.com>2015-02-11 11:20:59 +0100
commita893718c3165aa6ef6b2b500f7922954ba21eb02 (patch)
treecbc8692b54f5b6f72040000bfd6bf78d16b5bf9a /activerecord/CHANGELOG.md
parent9bdb083dba0778f47866fa440476b3141716de52 (diff)
downloadrails-a893718c3165aa6ef6b2b500f7922954ba21eb02.tar.gz
rails-a893718c3165aa6ef6b2b500f7922954ba21eb02.tar.bz2
rails-a893718c3165aa6ef6b2b500f7922954ba21eb02.zip
fix `remove_reference` with `foreign_key: true` on MySQL. #18664.
MySQL rejects to remove an index which is used in a foreign key constraint: ``` ActiveRecord::StatementInvalid: Mysql2::Error: Cannot drop index 'index_copies_on_title_id': needed in a foreign key constraint: ALTER TABLE `copies` DROP `title_id` ``` Removing the constraint before removing the column (and the index) solves this problem.
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r--activerecord/CHANGELOG.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index c1b803c7f8..064c9008e0 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -1,3 +1,11 @@
+* `remove_reference` with `foreign_key: true` removes the foreign key before
+ removing the column. This fixes a bug where it was not possible to remove
+ the column on MySQL.
+
+ Fixes #18664.
+
+ *Yves Senn*
+
* `find_in_batches` now accepts an `:end_at` parameter that complements the `:start`
parameter to specify where to stop batch processing.