diff --git a/bin/riesel b/bin/riesel index 3e3c150..af63711 100755 --- a/bin/riesel +++ b/bin/riesel @@ -14,4 +14,15 @@ done url=$(cat Rocket.toml | grep url | cut -d '"' -f 2) -diesel --database-url $url $@ +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 $@ +fi