aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/CHANGELOG.md
diff options
context:
space:
mode:
authorfatkodima <fatkodima@rambler.ru>2017-12-09 18:02:51 +0200
committerfatkodima <fatkodima123@gmail.com>2018-11-08 15:26:07 +0200
commit6e0ff0053702cd1dc0f149f4ca59f968a2560d72 (patch)
tree8cb2303b510fb0b815ce95c5335015c74ec95642 /activerecord/CHANGELOG.md
parent7f7e7e8b39f56d35993bec4247ac0295cd0c943e (diff)
downloadrails-6e0ff0053702cd1dc0f149f4ca59f968a2560d72.tar.gz
rails-6e0ff0053702cd1dc0f149f4ca59f968a2560d72.tar.bz2
rails-6e0ff0053702cd1dc0f149f4ca59f968a2560d72.zip
Add an :if_not_exists option to create_table
[fatkodima & Stefan Kanev]
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r--activerecord/CHANGELOG.md19
1 files changed, 19 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index f57ca1854f..2a237f86cf 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -1,3 +1,22 @@
+* Add an `:if_not_exists` option to `create_table`.
+
+ Example:
+
+ create_table :posts, if_not_exists: true do |t|
+ t.string :title
+ end
+
+ That would execute:
+
+ CREATE TABLE IF NOT EXISTS posts (
+ ...
+ )
+
+ If the table already exists, `if_not_exists: false` (the default) raises an
+ exception whereas `if_not_exists: true` does nothing.
+
+ *fatkodima*, *Stefan Kanev*
+
* Defining an Enum as a Hash with blank key, or as an Array with a blank value, now raises an `ArgumentError`.
*Christophe Maximin*