Class: ActiveRecord::ConnectionAdapters::PostgreSQLAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/activerecord/connection_adapters/postgresql_adapter.rb

Instance Method Summary collapse

Instance Method Details

#change_column_comment(table_name, column_name, comment) ⇒ Object



13
14
15
# File 'lib/activerecord/connection_adapters/postgresql_adapter.rb', line 13

def change_column_comment(table_name, column_name, comment)
  execute "COMMENT ON COLUMN #{quote_table_name(table_name)}.#{quote_column_name(column_name)} IS '#{quote_string(comment)}'"
end

#change_column_with_comment(table_name, column_name, type, options = {}) ⇒ Object



6
7
8
9
10
# File 'lib/activerecord/connection_adapters/postgresql_adapter.rb', line 6

def change_column_with_comment(table_name, column_name, type, options = {})
  comment = options.fetch(:comment){ nil }
  change_column_without_comment(table_name, column_name, type, options = {})
  change_column_comment(table_name, column_name, comment) unless comment.nil?
end