From 202d6578f44ab03ee89ed57b73a97d513fc5a008 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Sat, 23 Sep 2017 15:34:56 +0900 Subject: 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. --- activerecord/lib/active_record/migration/compatibility.rb | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'activerecord/lib/active_record/migration') 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 -- cgit v1.2.3