Last active
August 29, 2015 14:06
-
-
Save woecifaun/1861943c3db05a724bc1 to your computer and use it in GitHub Desktop.
Little helper for Symfony doctrine:schema:update
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
output="$(php app/console doctrine:schema:update --dump-sql)"; | |
echo $output; | |
case $output in | |
Nothing* ) return 0;; | |
esac | |
printf "\n"; | |
while true; do | |
read -p "Update database schema for real? (y or n):" yn | |
case $yn in | |
[Yy]* ) php app/console doctrine:schema:update --force; break;; | |
[Nn]* ) return 0;; | |
* ) echo "Please answer yes [y] or no [n].";; | |
esac | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Symfony Doctrine Schema Update Little Helper
A simple shell script to avoid the call of
php app/console doctrine:schema:update --dump-sql
then
php app/console doctrine:schema:update --force
Installation
install this file into your shell PATH scope.
Use
doctrine_schema_update
.y
if you effectively want your schema to be updatedn
otherwisetips
alias dsu="doctrine_schema_update"
to your shell customization to just launch the script by typingdsu