summaryrefslogtreecommitdiffstats
path: root/schema
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 /schema
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 'schema')
-rw-r--r--schema/Makefile11
1 files changed, 11 insertions, 0 deletions
diff --git a/schema/Makefile b/schema/Makefile
new file mode 100644
index 00000000..e0448add
--- /dev/null
+++ b/schema/Makefile
@@ -0,0 +1,11 @@
+aur-schema-sqlite.sql: aur-schema.sql
+ sed \
+ -e 's/ ENGINE = InnoDB//' \
+ -e 's/ [A-Z]* UNSIGNED NOT NULL AUTO_INCREMENT/ INTEGER NOT NULL/' \
+ -e 's/([0-9, ]*) UNSIGNED / UNSIGNED /' \
+ $< >$@
+
+clean:
+ rm -rf aur-schema-sqlite.sql
+
+.PHONY: clean