From 3628025c0dea3e08ea386700ec5eea27a26ce5d6 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Thu, 11 Dec 2014 22:57:28 +0900 Subject: Improve a dump of the primary key support. If it is not a default primary key, correctly dump the type and options. --- .../lib/active_record/connection_adapters/postgresql/column.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activerecord/lib/active_record/connection_adapters/postgresql') 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 -- cgit v1.2.3