From 44859db499f080e3a341f3e7fa5e44611fc2f887 Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Fri, 12 Aug 2022 01:46:42 +0200 Subject: Push local state... --- bundle/scripts/db_migrations.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'bundle/scripts/db_migrations.sh') diff --git a/bundle/scripts/db_migrations.sh b/bundle/scripts/db_migrations.sh index b0e1131c..83f15a2b 100755 --- a/bundle/scripts/db_migrations.sh +++ b/bundle/scripts/db_migrations.sh @@ -1,5 +1,13 @@ #!/bin/sh -read -p "Enter migration filename: " FILENAME + +if [ ! -z "$1" ] +then + FILENAME="$1" + echo "Using filename: $FILENAME" +else + read -p "Enter migration filename: " FILENAME +fi + [ -f ".env" ] && ( mv .env .env.tmp source .env.tmp @@ -8,8 +16,8 @@ read -p "Enter migration filename: " FILENAME make_migration() { echo "Creating migrations for $2" mkdir "../util/src/migrations/$2" - npm run build clean logerrors pretty-errors - THREADS=1 DATABASE="$1" DB_MIGRATE=a npm run start:bundle +# npm run build clean logerrors pretty-errors +# THREADS=1 DATABASE="$1" DB_MIGRATE=a npm run start:bundle THREADS=1 DATABASE="$1" DB_MIGRATE=a npx typeorm-ts-node-commonjs migration:generate "../util/src/migrations/$2/$FILENAME" -d ../util/src/util/Database.ts -p npm run build clean logerrors pretty-errors THREADS=1 DATABASE="$1" DB_MIGRATE=a npm run start:bundle -- cgit 1.5.1