Module: MigrationComments::ActiveRecord::ConnectionAdapters::AbstractAdapter
- Defined in:
- lib/migration_comments/active_record/connection_adapters/abstract_adapter.rb,
lib/migration_comments/active_record/connection_adapters/abstract_adapter/schema_creation.rb
Defined Under Namespace
Modules: SchemaCreation
Instance Method Summary collapse
- #add_column_comment(*args) ⇒ Object
- #add_table_comment(*args) ⇒ Object
- #comments_supported? ⇒ Boolean
-
#independent_comments? ⇒ Boolean
PostgreSQL style - comment specific commands.
-
#inline_comments? ⇒ Boolean
SQLite style - embedded comments.
-
#remove_column_comment(table_name, column_name) ⇒ Object
Remove a comment on a column (if set).
-
#remove_table_comment(table_name) ⇒ Object
Remove a comment on a table (if set).
- #retrieve_column_comment(table_name, column_name) ⇒ Object
- #retrieve_column_comments(table_name, *column_names) ⇒ Object
- #retrieve_table_comment(table_name) ⇒ Object
- #set_column_comment(table_name, column_name, comment_text) ⇒ Object
- #set_table_comment(table_name, comment_text) ⇒ Object
Instance Method Details
#add_column_comment(*args) ⇒ Object
13 14 15 16 |
# File 'lib/migration_comments/active_record/connection_adapters/abstract_adapter.rb', line 13 def add_column_comment(*args) puts "'add_column_comment' is deprecated, and will be removed in future releases. Use 'set_column_comment' instead." set_column_comment(*args) end |
#add_table_comment(*args) ⇒ Object
9 10 11 12 |
# File 'lib/migration_comments/active_record/connection_adapters/abstract_adapter.rb', line 9 def add_table_comment(*args) puts "'add_table_comment' is deprecated, and will be removed in future releases. Use 'set_table_comment' instead." set_table_comment(*args) end |
#comments_supported? ⇒ Boolean
18 19 20 |
# File 'lib/migration_comments/active_record/connection_adapters/abstract_adapter.rb', line 18 def comments_supported? false end |
#independent_comments? ⇒ Boolean
PostgreSQL style - comment specific commands
28 29 30 |
# File 'lib/migration_comments/active_record/connection_adapters/abstract_adapter.rb', line 28 def independent_comments? false end |
#inline_comments? ⇒ Boolean
SQLite style - embedded comments
23 24 25 |
# File 'lib/migration_comments/active_record/connection_adapters/abstract_adapter.rb', line 23 def inline_comments? false end |
#remove_column_comment(table_name, column_name) ⇒ Object
Remove a comment on a column (if set)
38 39 40 |
# File 'lib/migration_comments/active_record/connection_adapters/abstract_adapter.rb', line 38 def remove_column_comment(table_name, column_name) set_column_comment(table_name, column_name, nil) end |
#remove_table_comment(table_name) ⇒ Object
Remove a comment on a table (if set)
33 34 35 |
# File 'lib/migration_comments/active_record/connection_adapters/abstract_adapter.rb', line 33 def remove_table_comment(table_name) set_table_comment(table_name, nil) end |
#retrieve_column_comment(table_name, column_name) ⇒ Object
50 51 52 |
# File 'lib/migration_comments/active_record/connection_adapters/abstract_adapter.rb', line 50 def retrieve_column_comment(table_name, column_name) retrieve_column_comments(table_name, column_name)[column_name] end |
#retrieve_column_comments(table_name, *column_names) ⇒ Object
46 47 48 |
# File 'lib/migration_comments/active_record/connection_adapters/abstract_adapter.rb', line 46 def retrieve_column_comments(table_name, *column_names) {} end |
#retrieve_table_comment(table_name) ⇒ Object
42 43 44 |
# File 'lib/migration_comments/active_record/connection_adapters/abstract_adapter.rb', line 42 def retrieve_table_comment(table_name) nil end |
#set_column_comment(table_name, column_name, comment_text) ⇒ Object
6 7 |
# File 'lib/migration_comments/active_record/connection_adapters/abstract_adapter.rb', line 6 def set_column_comment(table_name, column_name, comment_text) end |
#set_table_comment(table_name, comment_text) ⇒ Object
3 4 |
# File 'lib/migration_comments/active_record/connection_adapters/abstract_adapter.rb', line 3 def set_table_comment(table_name, comment_text) end |