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>
This commit is contained in:
Lukas Fleischer 2017-03-01 20:12:57 +01:00
parent 48f2837525
commit da4bd3b59e
3 changed files with 18 additions and 10 deletions

11
schema/Makefile Normal file
View file

@ -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