Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Remove db:structure:dump
# Place it in lib/tasks/
env = ENV['RACK_ENV'] || ENV['RAILS_ENV']
if env == 'production' || env == 'staging'
Rake::TaskManager.class_eval do
def remove_task(task_name)
@tasks.delete(task_name.to_s)
end
end
Rake.application.remove_task('db:structure:dump')
Rake.application.remove_task('db:schema:dump')
namespace :db do
namespace :structure do
task :dump do
# Overridden to do nothing
end
end
namespace :schema do
task :dump do
# Overridden to do nothing
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.