Last Updated: February 25, 2016
·
3.133K
· damienalexandre

Alias to reset your whole Doctrine DB

Improve your life as a Symfony2 developper, use aliases!

alias doctrinereset='./app/console doctrine:schema:drop --force;./app/console doctrine:schema:create;./app/console doctrine:fixtures:load -n;alert'

(this is to be added to a .bashrc file, or better, .bash_aliases, in your home folder)

The "alert" command display a notification at the end of the command so you don't have to stare at it to know if it worked. It's by default on Ubuntu:

alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'

Feel free to remove the "alert" part.