summary refs log tree commit diff
path: root/scripts/db_migrations.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/db_migrations.sh')
-rwxr-xr-xscripts/db_migrations.sh41
1 files changed, 0 insertions, 41 deletions
diff --git a/scripts/db_migrations.sh b/scripts/db_migrations.sh
deleted file mode 100755
index 9ec8230a..00000000
--- a/scripts/db_migrations.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/sh
-
-if [ ! -z "$1" ]
-then
-    FILENAME="$1"
-    echo "Using filename: $FILENAME"
-else
-    read -p "Enter migration filename: " FILENAME
-fi
-
-[ -f ".env" ] && (
-    mv .env .env.tmp 2>/dev/null
-    source .env.tmp 2>/dev/null
-)
-npm run build clean logerrors pretty-errors
-
-make_migration() {
-    echo "Creating migrations for $2"
-    mkdir "src/util/migrations/$2" 2>/dev/null
-#    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 "src/util/migrations/$2/$FILENAME" -d src/util/util/Database.ts -p
-    #npm run build clean logerrors pretty-errors
-    #THREADS=1 DATABASE="$1" DB_MIGRATE=a npm run start:bundle
-}
-
-npm i sqlite3
-make_migration "database.db" "sqlite"
-
-[ -z "$FC_DB_POSTGRES" ] || (
-    npm i pg
-    make_migration "$FC_DB_POSTGRES" "postgres"
-)
-
-[ -z "$FC_DB_MARIADB" ] || (
-    npm i mysql2
-    make_migration "$FC_DB_MARIADB" "mariadb"
-)
-
-[ -f ".env.tmp" ] && mv .env.tmp .env 2>/dev/null
-