Module: DynamicMigrations::ActiveRecord::Migrators::Table

Included in:
DynamicMigrations::ActiveRecord::Migrators
Defined in:
lib/dynamic_migrations/active_record/migrators/table.rb

Instance Method Summary collapse

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 <<~SQL
    COMMENT ON TABLE #{schema_name}.#{table_name} IS NULL;
  SQL
end

#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 <<~SQL
    COMMENT ON TABLE #{schema_name}.#{table_name} IS #{quote comment};
  SQL
end