aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/migration
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2017-09-23 15:34:56 +0900
committerRyuta Kamizono <kamipo@gmail.com>2017-09-23 15:48:49 +0900
commit202d6578f44ab03ee89ed57b73a97d513fc5a008 (patch)
tree40b9dbe22068b0d60c157deb98a98c42b3527619 /activerecord/lib/active_record/migration
parentdfe6939e16bdcf854d32b61933d55fe313ac49fb (diff)
downloadrails-202d6578f44ab03ee89ed57b73a97d513fc5a008.tar.gz
rails-202d6578f44ab03ee89ed57b73a97d513fc5a008.tar.bz2
rails-202d6578f44ab03ee89ed57b73a97d513fc5a008.zip
Move integer-like primary key normalization to `new_column_definition`
Currently the normalization only exists in `primary_key` shorthand. It should be moved to `new_column_definition` to also affect to `add_column` with primary key.
Diffstat (limited to 'activerecord/lib/active_record/migration')
-rw-r--r--activerecord/lib/active_record/migration/compatibility.rb8
1 files changed, 1 insertions, 7 deletions
diff --git a/activerecord/lib/active_record/migration/compatibility.rb b/activerecord/lib/active_record/migration/compatibility.rb
index 92993d64a7..502cef2e20 100644
--- a/activerecord/lib/active_record/migration/compatibility.rb
+++ b/activerecord/lib/active_record/migration/compatibility.rb
@@ -93,13 +93,7 @@ module ActiveRecord
def add_column(table_name, column_name, type, options = {})
if type == :primary_key
- case adapter_name
- when "PostgreSQL"
- type = :serial
- when "Mysql2"
- type = :integer
- options[:auto_increment] = true
- end
+ type = :integer
options[:primary_key] = true
end
super