Class: CopyBot::Steps::DropLocalDbTables
- Defined in:
- lib/copy_bot/steps/drop_local_db_tables.rb
Instance Attribute Summary
Attributes inherited from BaseStep
Instance Method Summary collapse
Methods inherited from BaseStep
Constructor Details
This class inherits a constructor from CopyBot::Steps::BaseStep
Instance Method Details
#run ⇒ String
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/copy_bot/steps/drop_local_db_tables.rb', line 5 def run conn = ActiveRecord::Base.connection conn.tables.each do |table| CopyBot.config.logger.info("Dropping #{table}") conn.drop_table(table, force: :cascade, if_exists: true) end @success = true @message = 'Reset local DB schema.' end |