Skip to content

Instantly share code, notes, and snippets.

@alg
Created April 30, 2014 18:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alg/dd510533ae8bd1136ded to your computer and use it in GitHub Desktop.
Save alg/dd510533ae8bd1136ded to your computer and use it in GitHub Desktop.
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