aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2016-03-11 11:27:09 -0300
committerRafael França <rafaelmfranca@gmail.com>2016-03-11 11:27:09 -0300
commit4d7e96910f7704e08eb193ddf47323cc71a8ab11 (patch)
treed869d4a7290791bcfd1f0a021a09a57e9c3e7f80 /activerecord/lib/active_record
parentc9219a75fc03cb5e7e1a267659426c894bc8da42 (diff)
parent37024ce479676bbb338d4083dbc31f34a1eca893 (diff)
downloadrails-4d7e96910f7704e08eb193ddf47323cc71a8ab11.tar.gz
rails-4d7e96910f7704e08eb193ddf47323cc71a8ab11.tar.bz2
rails-4d7e96910f7704e08eb193ddf47323cc71a8ab11.zip
Merge pull request #24087 from kamipo/dump_bigint_instead_of_integer_limit_8
Dump `bigint` instead of `integer` with `limit: 8` for schema dumper
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/schema_dumper.rb8
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql/schema_dumper.rb4
2 files changed, 6 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_dumper.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_dumper.rb
index 2209874d0a..9e653cd7c4 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/schema_dumper.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_dumper.rb
@@ -57,11 +57,15 @@ module ActiveRecord
private
def schema_type(column)
- column.type
+ if column.bigint?
+ :bigint
+ else
+ column.type
+ end
end
def schema_limit(column)
- limit = column.limit
+ limit = column.limit unless column.bigint?
limit.inspect if limit && limit != native_database_types[column.type][:limit]
end
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/schema_dumper.rb b/activerecord/lib/active_record/connection_adapters/postgresql/schema_dumper.rb
index 5cb2bbbf18..19761618cf 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql/schema_dumper.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql/schema_dumper.rb
@@ -41,10 +41,6 @@ module ActiveRecord
end
end
- def schema_limit(column)
- super unless schema_type(column) == :bigserial
- end
-
def schema_expression(column)
super unless column.serial?
end