summaryrefslogtreecommitdiffstats
path: root/test/setup.sh
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2017-03-01 20:12:57 +0100
committerLukas Fleischer <lfleischer@archlinux.org>2017-03-01 20:12:57 +0100
commitda4bd3b59efe63899e2271980cf1c7751b9fa6dc (patch)
treecc47c10c1648745ba80296f98505b886105047a2 /test/setup.sh
parent48f28375255a2614269e4c6c38ecd6c61fe44cfd (diff)
downloadaur-da4bd3b59efe63899e2271980cf1c7751b9fa6dc.tar.gz
aur-da4bd3b59efe63899e2271980cf1c7751b9fa6dc.tar.xz
Add a Makefile to build an SQLite-compatible schema
Allow for automatically converting the schema into a schema that works with SQLite by running `make` from the schema/ subdirectory. Use the new Makefile in the test suite. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'test/setup.sh')
-rw-r--r--test/setup.sh9
1 files changed, 1 insertions, 8 deletions
diff --git a/test/setup.sh b/test/setup.sh
index 2959a4e6..64ba88f2 100644
--- a/test/setup.sh
+++ b/test/setup.sh
@@ -106,14 +106,7 @@ export SSH_CLIENT SSH_CONNECTION SSH_TTY
# Initialize the test database.
rm -f aur.db
-sed \
- -e '/^DROP DATABASE /d' \
- -e '/^CREATE DATABASE /d' \
- -e '/^USE /d' \
- -e 's/ ENGINE = InnoDB//' \
- -e 's/ [A-Z]* UNSIGNED NOT NULL AUTO_INCREMENT/ INTEGER NOT NULL/' \
- -e 's/([0-9, ]*) UNSIGNED / UNSIGNED /' \
- "$TOPLEVEL/schema/aur-schema.sql" | sqlite3 aur.db
+sqlite3 aur.db <"$TOPLEVEL/schema/aur-schema-sqlite.sql"
echo "INSERT INTO Users (ID, UserName, Passwd, Email, AccountTypeID) VALUES (1, 'user', '!', 'user@localhost', 1);" | sqlite3 aur.db
echo "INSERT INTO Users (ID, UserName, Passwd, Email, AccountTypeID) VALUES (2, 'tu', '!', 'tu@localhost', 2);" | sqlite3 aur.db