summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 $@
+