Method deprecated or moved
This method is deprecated or moved on the latest stable version.
The last existing version (v4.1.8) is shown here.
default_sequence_name(table_name, pk = nil)
public
Returns the sequence name for a table’s primary key or some other
specified key.
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb, line 278
def default_sequence_name(table_name, pk = nil) #:nodoc:
result = serial_sequence(table_name, pk || 'id')
return nil unless result
result.split('.').last
rescue ActiveRecord::StatementInvalid
"#{table_name}_#{pk || 'id'}_seq"
end