I have a rake task that won\'t work unless a table exists. I\'m working with more than 20 engineers on a website so I want to make sure they have migrated the table before they
Rails 5.1
if ActiveRecord::Base.connection.data_source_exists? 'table_name' drop_table :table_name end
or
drop_table :table_name, if_exists: true