blob: 1b67cee24b349fa1fba7a0d20f8f997752eeb45a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
# frozen_string_literal: true
module ActiveRecord
module ConnectionAdapters
# PostgreSQL-specific extensions to column definitions in a table.
class PostgreSQLColumn < Column #:nodoc:
delegate :array, :oid, :fmod, to: :sql_type_metadata
alias :array? :array
def serial?
return unless default_function
%r{\Anextval\('"?#{table_name}_#{name}_seq"?'::regclass\)\z} === default_function
end
end
end
end
|