module PgSaurus::ConnectionAdapters::AbstractAdapter::CommentMethods
Extends ActiveRecord::ConnectionAdapters::AbstractAdapter with empty methods for comments feature.
Public Instance Methods
remove_column_comment(table_name, column_name)
click to toggle source
Removes any comment from the given column of a given table.
Example¶ ↑
Removing comment from the npa column of table phone_numbers¶ ↑
remove_column_comment :phone_numbers, :npa
# File lib/pg_saurus/connection_adapters/abstract_adapter/comment_methods.rb, line 59 def remove_column_comment(table_name, column_name) end
remove_column_comments(table_name, *column_names)
click to toggle source
Removes any comment from the given columns of a given table.
Example¶ ↑
Removing comment from the npa and nxx columns of table phone_numbers¶ ↑
remove_column_comments :phone_numbers, :npa, :nxx
# File lib/pg_saurus/connection_adapters/abstract_adapter/comment_methods.rb, line 68 def remove_column_comments(table_name, *column_names) end
remove_index_comment(index_name)
click to toggle source
remove_table_comment(table_name)
click to toggle source
set_column_comment(table_name, column_name, comment)
click to toggle source
Sets a comment on a given column of a given table.
Example¶ ↑
Creating a comment on npa column of table phone_numbers¶ ↑
set_column_comment :phone_numbers, :npa, 'Numbering Plan Area Code - Allowed ranges: [2-9] for first digit, [0-9] for second and third digit.'
# File lib/pg_saurus/connection_adapters/abstract_adapter/comment_methods.rb, line 22 def set_column_comment(table_name, column_name, comment) # Does nothing end
set_column_comments(table_name, comments)
click to toggle source
Sets comments on multiple columns. 'comments' is a hash of column_name => comment pairs.
Example¶ ↑
Setting comments on the columns of the phone_numbers table¶ ↑
set_column_comments :phone_numbers, :npa => 'Numbering Plan Area Code - Allowed ranges: [2-9] for first digit, [0-9] for second and third digit.', :nxx => 'Central Office Number'
# File lib/pg_saurus/connection_adapters/abstract_adapter/comment_methods.rb, line 32 def set_column_comments(table_name, comments) end
set_index_comment(index_name, comment)
click to toggle source
set_table_comment(table_name, comment)
click to toggle source
Sets a comment on the given table.
Example¶ ↑
Creating a comment on phone_numbers table¶ ↑
set_table_comment :phone_numbers, 'This table stores phone numbers that conform to the North American Numbering Plan.'
# File lib/pg_saurus/connection_adapters/abstract_adapter/comment_methods.rb, line 13 def set_table_comment(table_name, comment) # Does nothing end
supports_comments?()
click to toggle source
# File lib/pg_saurus/connection_adapters/abstract_adapter/comment_methods.rb, line 4 def supports_comments? false end