diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-03-26 17:26:20 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-03-26 17:26:20 -0300 |
commit | fb522a27731e04d149abe68809fa030382931bc3 (patch) | |
tree | c3f70cd34da8df0a6a515e6ce4f189f16ec36828 /activerecord/CHANGELOG.md | |
parent | 9ed0cf51b467907810ef3959c8e9cdf77370370e (diff) | |
parent | 63c94efccb20c0b398dd90c0d209d6894eb22d92 (diff) | |
download | rails-fb522a27731e04d149abe68809fa030382931bc3.tar.gz rails-fb522a27731e04d149abe68809fa030382931bc3.tar.bz2 rails-fb522a27731e04d149abe68809fa030382931bc3.zip |
Merge pull request #14480 from steverice/mysql-indexes-in-create-table
Create indexes inline in CREATE TABLE for MySQL
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r-- | activerecord/CHANGELOG.md | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 6e77493de9..ccd07ce248 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,3 +1,18 @@ +* Create indexes inline in CREATE TABLE for MySQL + + This is important, because adding an index on a temporary table after it has been created + would commit the transaction. + It also allows creating and dropping indexed tables with fewer queries and fewer permissions required. + + Example: + + create_table :temp, temporary: true, as: "SELECT id, name, zip FROM a_really_complicated_query" do |t| + t.index :zip + end + # => CREATE TEMPORARY TABLE temp (INDEX (zip)) AS SELECT id, name, zip FROM a_really_complicated_query + + *Cody Cutrer*, *Steve Rice* + * Save `has_one` association even if the record doesn't changed. Fixes #14407. |