aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/postgresql
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2014-12-11 22:57:28 +0900
committerRyuta Kamizono <kamipo@gmail.com>2014-12-29 09:19:21 +0900
commit3628025c0dea3e08ea386700ec5eea27a26ce5d6 (patch)
tree933654027988dc4ec799597ad47eb1925487e237 /activerecord/lib/active_record/connection_adapters/postgresql
parent73fe108d700cc2fa85bc7775c5a2ca9ca529849a (diff)
downloadrails-3628025c0dea3e08ea386700ec5eea27a26ce5d6.tar.gz
rails-3628025c0dea3e08ea386700ec5eea27a26ce5d6.tar.bz2
rails-3628025c0dea3e08ea386700ec5eea27a26ce5d6.zip
Improve a dump of the primary key support.
If it is not a default primary key, correctly dump the type and options.
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/postgresql')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql/column.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/column.rb b/activerecord/lib/active_record/connection_adapters/postgresql/column.rb
index 37e5c3859c..1458fbf496 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql/column.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql/column.rb
@@ -15,6 +15,10 @@ module ActiveRecord
@default_function = default_function
end
+
+ def serial?
+ default_function && default_function =~ /\Anextval\(.*\)\z/
+ end
end
end
end