From c1f3f21cec1b44c097ea10d8337f3960dc8b4bb7 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 25 May 2016 21:27:17 +0100 Subject: Add make file for updating schema --- gentoobrowse-api/db/database.mk | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 gentoobrowse-api/db/database.mk diff --git a/gentoobrowse-api/db/database.mk b/gentoobrowse-api/db/database.mk new file mode 100644 index 0000000..c8b68ce --- /dev/null +++ b/gentoobrowse-api/db/database.mk @@ -0,0 +1,13 @@ +.PHONY : database current.sql schema.sql + +database: bin/patch.sql + psql -U gentoo gentoobrowse -qf $< + +bin/current.sql : + mkdir -p bin + pg_dump -U gentoo gentoobrowse -n gentoobrowse -s -E utf8 | grep -v _gentoo > $@ + +bin/patch.sql : bin/current.sql schema.sql + mkdir -p bin + apgdiff --add-transaction bin/current.sql schema.sql | tee $@ + -- cgit v1.2.3