riesel migration redo all

This commit is contained in:
Thomas Forgione 2020-07-20 10:05:06 +02:00
parent 5a9f748add
commit e926bdf95c
1 changed files with 12 additions and 1 deletions

View File

@ -14,4 +14,15 @@ done
url=$(cat Rocket.toml | grep url | cut -d '"' -f 2) url=$(cat Rocket.toml | grep url | cut -d '"' -f 2)
if [ $# -eq 3 ] && [ "$1" == "migration" ] && [ "$2" == "redo" ] && [ "$3" == "all" ]; then
for i in `ls migrations`; do
diesel --database-url $url migration revert
done
diesel --database-url $url migration run
elif [ $# -eq 3 ] && [ "$1" == "migration" ] && [ "$2" == "revert" ] && [ "$3" == "all" ]; then
for i in `ls migrations`; do
diesel --database-url $url migration revert
done
else
diesel --database-url $url $@ diesel --database-url $url $@
fi