Module: DynamicMigrations::ActiveRecord::Migrators::Table
- Included in:
- DynamicMigrations::ActiveRecord::Migrators
- Defined in:
- lib/dynamic_migrations/active_record/migrators/table.rb
Instance Method Summary collapse
-
#remove_table_comment(table_name) ⇒ Object
remove a table comment.
-
#set_table_comment(table_name, comment) ⇒ Object
add a comment to the table.
Instance Method Details
#remove_table_comment(table_name) ⇒ Object
remove a table comment
13 14 15 16 17 |
# File 'lib/dynamic_migrations/active_record/migrators/table.rb', line 13 def remove_table_comment table_name execute " COMMENT ON TABLE \#{schema_name}.\#{table_name} IS NULL;\n SQL\nend\n" |
#set_table_comment(table_name, comment) ⇒ Object
add a comment to the table
6 7 8 9 10 |
# File 'lib/dynamic_migrations/active_record/migrators/table.rb', line 6 def set_table_comment table_name, comment execute " COMMENT ON TABLE \#{schema_name}.\#{table_name} IS \#{quote comment};\n SQL\nend\n" |