From 3abb01c177782dbd7eb403a53ff498f0a08938f4 Mon Sep 17 00:00:00 2001 From: Eliseu Egewarth Date: Mon, 14 May 2018 11:36:33 -0300 Subject: [PATCH] =?UTF-8?q?Adaptando=20script=20reset=5Fall=5Fmigrations.s?= =?UTF-8?q?h.=20Sempre=20executar=C3=A1=20a=20partir=20da=20raiz=20do=20re?= =?UTF-8?q?posit=C3=B3rio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Eliseu Egewarth --- scripts/{ => django}/reset_all_migrations.sh | 5 +++++ 1 file changed, 5 insertions(+) rename scripts/{ => django}/reset_all_migrations.sh (57%) diff --git a/scripts/reset_all_migrations.sh b/scripts/django/reset_all_migrations.sh similarity index 57% rename from scripts/reset_all_migrations.sh rename to scripts/django/reset_all_migrations.sh index 53e274fe9..d3f2cfbe4 100755 --- a/scripts/reset_all_migrations.sh +++ b/scripts/django/reset_all_migrations.sh @@ -3,6 +3,11 @@ # Sends all django migrations to the trash bin # Requires trash-cli. To install: # sudo apt-get install trash-cli +hash trash-put 2>/dev/null || { echo >&2 "I require trash-put but it's not installed. Aborting."; exit 1; } + +git_project_root=$(git rev-parse --show-toplevel) +cd ${git_project_root} + find -name 00*.py | grep /migrations/ | xargs trash-put # Make all migrations from scratch