##What is this?
This is a ruby file that makes dropping your database precariously, perilously even, tons of fun.
##Where is this?
I put mine in ~/local/boom/
so it's less likely to get accidentally moved or deleted or whatevered.
##How is this?
In my ~/.bash_profile
, I added an alias:
alias dropit='ruby ~/local/boom/wub.rb'
so that I can execute it anytime, anywhere in my terminal.
##Why is this?
Because it makes me laugh.
I also have this in my .bash_profile
:
alias dubstep='rake db:drop'
...and in my Sinatra app Rakefiles:
namespace :db do
desc "Drop the database at #{DB_NAME}"
task :drop do
exec %{
source ~/.bash_profile
shopt -s expand_aliases
dropit
}
system("dropdb #{DB_NAME}")
end
so whenever I need to drop the database, I just type $ dubstep
in the terminal from the Sinatra app root folder.
###BONUS
alias yolo='rake db:create && rake db:migrate && rake db:seed'
// hat tip to @dontmitch and @mikelikesbikes