From e926bdf95c14f38f4bc7d10ec376e3d5b86d3a87 Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Mon, 20 Jul 2020 10:05:06 +0200 Subject: [PATCH] riesel migration redo all --- bin/riesel | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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