summaryrefslogtreecommitdiffstats
path: root/schema/reloadtestdb.sh
diff options
context:
space:
mode:
authorFrédéric Mangano-Tarumi <fmang@mg0.fr>2020-02-16 21:56:10 +0100
committerLukas Fleischer <lfleischer@archlinux.org>2020-02-27 16:44:36 +0100
commit7188743fc3b1a9c1f5f65e323a6502d018bd95d5 (patch)
treed313ae39015fd5b664206048a946f420aecc7775 /schema/reloadtestdb.sh
parent4b2102ceb26b77bc8ee3e9b9d8929a915f1e65a9 (diff)
downloadaur-7188743fc3b1a9c1f5f65e323a6502d018bd95d5.tar.gz
aur-7188743fc3b1a9c1f5f65e323a6502d018bd95d5.tar.xz
Migrate the database schema to SQLAlchemy
The new schema was generated with sqlacodegen and then manually adjusted to fit schema/aur-schema.sql faithfully, both in the organisation of the code and in the SQL generated by SQLAlchemy. Initializing the database now requires the new tool aurweb.initdb. References to aur-schema.sql have been updated and the old schema dropped. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'schema/reloadtestdb.sh')
-rwxr-xr-xschema/reloadtestdb.sh29
1 files changed, 0 insertions, 29 deletions
diff --git a/schema/reloadtestdb.sh b/schema/reloadtestdb.sh
deleted file mode 100755
index e839dcec..00000000
--- a/schema/reloadtestdb.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash -e
-
-DB_NAME=${DB_NAME:-AUR}
-DB_USER=${DB_USER:-aur}
-# Password should allow empty definition
-DB_PASS=${DB_PASS-aur}
-DB_HOST=${DB_HOST:-localhost}
-DATA_FILE=${DATA_FILE:-dummy-data.sql}
-
-echo "Using database $DB_NAME, user $DB_USER, host $DB_HOST"
-
-mydir=$(pwd)
-if [ $(basename $mydir) != "schema" ]; then
- echo "you must be in the aurweb/schema directory to run this script"
- exit 1
-fi
-
-echo "recreating database..."
-mysql -h $DB_HOST -u $DB_USER -p$DB_PASS < aur-schema.sql
-
-if [ ! -f $DATA_FILE ]; then
- echo "creating dumy-data..."
- python3 gendummydata.py $DATA_FILE
-fi
-
-echo "loading dummy-data..."
-mysql -h $DB_HOST -u $DB_USER -p$DB_PASS $DB_NAME < $DATA_FILE
-
-echo "done."