Module: PgPower::ConnectionAdapters::AbstractAdapter::CommentMethods
- Included in:
- PgPower::ConnectionAdapters::AbstractAdapter
- Defined in:
- lib/pg_power/connection_adapters/abstract_adapter/comment_methods.rb
Overview
Extends ActiveRecord::ConnectionAdapters::AbstractAdapter with empty methods for comments feature.
Instance Method Summary collapse
-
#remove_column_comment(table_name, column_name) ⇒ Object
Removes any comment from the given column of a given table.
-
#remove_column_comments(table_name, *column_names) ⇒ Object
Removes any comment from the given columns of a given table.
-
#remove_index_comment(index_name) ⇒ Object
Removes the comment from the given index.
-
#remove_table_comment(table_name) ⇒ Object
Removes any comment from the given table.
-
#set_column_comment(table_name, column_name, comment) ⇒ Object
Sets a comment on a given column of a given table.
-
#set_column_comments(table_name, comments) ⇒ Object
Sets comments on multiple columns.
-
#set_index_comment(index_name, comment) ⇒ Object
Sets the comment on the given index.
-
#set_table_comment(table_name, comment) ⇒ Object
Sets a comment on the given table.
- #supports_comments? ⇒ Boolean
Instance Method Details
#remove_column_comment(table_name, column_name) ⇒ Object
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
59 60 61 |
# File 'lib/pg_power/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) ⇒ Object
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
68 69 70 |
# File 'lib/pg_power/connection_adapters/abstract_adapter/comment_methods.rb', line 68 def remove_column_comments(table_name, *column_names) end |
#remove_index_comment(index_name) ⇒ Object
Removes the comment from the given index
Example
Removing comment from the index_pets_on_breed_id index
remove_index_comment :index_pets_on_breed_id
77 78 79 |
# File 'lib/pg_power/connection_adapters/abstract_adapter/comment_methods.rb', line 77 def remove_index_comment(index_name) end |
#remove_table_comment(table_name) ⇒ Object
Removes any comment from the given table.
Example
Removing comment from phone numbers table
remove_table_comment :phone_numbers
50 51 52 |
# File 'lib/pg_power/connection_adapters/abstract_adapter/comment_methods.rb', line 50 def remove_table_comment(table_name) end |
#set_column_comment(table_name, column_name, comment) ⇒ Object
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.'
22 23 24 |
# File 'lib/pg_power/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) ⇒ Object
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'
32 33 34 |
# File 'lib/pg_power/connection_adapters/abstract_adapter/comment_methods.rb', line 32 def set_column_comments(table_name, comments) end |
#set_index_comment(index_name, comment) ⇒ Object
Sets the comment on the given index
Example
Setting comment on the index_pets_on_breed_id index
set_index_comment 'index_pets_on_breed_id', 'Index on breed_id'
41 42 43 |
# File 'lib/pg_power/connection_adapters/abstract_adapter/comment_methods.rb', line 41 def set_index_comment(index_name, comment) end |
#set_table_comment(table_name, comment) ⇒ Object
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.'
13 14 15 |
# File 'lib/pg_power/connection_adapters/abstract_adapter/comment_methods.rb', line 13 def set_table_comment(table_name, comment) # Does nothing end |
#supports_comments? ⇒ Boolean
4 5 6 |
# File 'lib/pg_power/connection_adapters/abstract_adapter/comment_methods.rb', line 4 def supports_comments? false end |