aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb
diff options
context:
space:
mode:
authorJeremy Daer <jeremydaer@gmail.com>2017-02-06 22:16:19 -0700
committerJeremy Daer <jeremydaer@gmail.com>2017-02-06 22:16:19 -0700
commit968e66b5df92e5ae88c033dc552e17b4c736874b (patch)
treed3ff117eef279026e544fc12bc81aaf25fb4c411 /activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb
parente0e20d62a75d2c05c7f68e0f316effd5c2f5c26f (diff)
parent29c70abc58357e7b0f6b05e9ca89ba7a95617ed5 (diff)
downloadrails-968e66b5df92e5ae88c033dc552e17b4c736874b.tar.gz
rails-968e66b5df92e5ae88c033dc552e17b4c736874b.tar.bz2
rails-968e66b5df92e5ae88c033dc552e17b4c736874b.zip
Merge pull request #27389 from kamipo/fix_mysql_pk_dumping_correctly
Restore the behaviour of the compatibility layer for integer-like PKs * kamipo/fix_mysql_pk_dumping_correctly: Restore custom primary key tests lost at #26266 Restore the behaviour of the compatibility layer for integer-like PKs Correctly dump integer-like primary key with default nil
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb b/activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb
index c3e182b43d..0443bd8bdd 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb
@@ -42,7 +42,7 @@ module ActiveRecord
# a record (as primary keys cannot be +nil+). This might be done via the
# +SecureRandom.uuid+ method and a +before_save+ callback, for instance.
def primary_key(name, type = :primary_key, **options)
- options[:auto_increment] = true if [:primary_key, :integer, :bigint].include?(type) && !options.key?(:default)
+ options[:auto_increment] = true if [:integer, :bigint].include?(type) && !options.key?(:default)
if type == :uuid
options[:default] = options.fetch(:default, "gen_random_uuid()")
elsif options.delete(:auto_increment) == true && %i(integer bigint).include?(type)