summary refs log tree commit diff
path: root/scripts/db_migrations.sh
diff options
context:
space:
mode:
authorCatalan Lover <48515417+FSG-Cat@users.noreply.github.com>2022-08-23 23:50:01 +0200
committerGitHub <noreply@github.com>2022-08-23 23:50:01 +0200
commitd63451b3fe6c0c6ab175adec82361834bb3633f5 (patch)
treeb738ee25bf9819300e1802ba9a8e2813e9dc2588 /scripts/db_migrations.sh
parentMerge pull request #1 from FSG-Cat/FSG-Cat-patch-1 (diff)
parentCheck Captcha (diff)
downloadserver-d63451b3fe6c0c6ab175adec82361834bb3633f5.tar.xz
Merge branch 'fosscord:staging' into Bug-Report-Template
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 -