diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-10-29 18:11:51 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-10-29 18:12:22 -0700 |
commit | 6dc178711de036ae9a441e83978b7ed740be2f63 (patch) | |
tree | 3df384826549ea74ef0e9dd52a158bb038c77710 /activerecord/lib/active_record | |
parent | f9d4b50944e09273e299ff1b3cec5638320b7ae9 (diff) | |
download | rails-6dc178711de036ae9a441e83978b7ed740be2f63.tar.gz rails-6dc178711de036ae9a441e83978b7ed740be2f63.tar.bz2 rails-6dc178711de036ae9a441e83978b7ed740be2f63.zip |
add bigserial pk support
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | 1 | ||||
-rw-r--r-- | activerecord/lib/active_record/schema_dumper.rb | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index 3294238fa0..bf2941b777 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -78,6 +78,7 @@ module ActiveRecord NATIVE_DATABASE_TYPES = { primary_key: "serial primary key", + bigserial: "bigserial", string: { name: "character varying" }, text: { name: "text" }, integer: { name: "integer" }, diff --git a/activerecord/lib/active_record/schema_dumper.rb b/activerecord/lib/active_record/schema_dumper.rb index 82c5ca291c..261fb9d992 100644 --- a/activerecord/lib/active_record/schema_dumper.rb +++ b/activerecord/lib/active_record/schema_dumper.rb @@ -118,6 +118,8 @@ HEADER if pkcol if pk != 'id' tbl.print %Q(, primary_key: "#{pk}") + elsif pkcol.sql_type == 'bigint' + tbl.print ", id: :bigserial" elsif pkcol.sql_type == 'uuid' tbl.print ", id: :uuid" tbl.print %Q(, default: "#{pkcol.default_function}") if pkcol.default_function |