summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2016-05-25 21:27:17 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2016-05-25 21:27:17 +0100
commitc178411209e896db2ca6ba874e877f41fe3ba966 (patch)
tree020c0ffb7d0acdf68f47e1e97032c414f4c609e8
parentFix order of properties on firstseen (diff)
downloadgentoobrowse-api-c178411209e896db2ca6ba874e877f41fe3ba966.tar.bz2
gentoobrowse-api-c178411209e896db2ca6ba874e877f41fe3ba966.tar.xz
gentoobrowse-api-c178411209e896db2ca6ba874e877f41fe3ba966.zip
Add make file for updating schemagentoobrowse-api-0.4
-rw-r--r--gentoobrowse-api/db/database.mk13
1 files changed, 13 insertions, 0 deletions
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 $@
+