diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2016-05-25 21:27:17 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2016-05-25 21:27:17 +0100 |
commit | c1f3f21cec1b44c097ea10d8337f3960dc8b4bb7 (patch) | |
tree | 020c0ffb7d0acdf68f47e1e97032c414f4c609e8 | |
parent | Fix order of properties on firstseen (diff) | |
download | gentoobrowse-api-c1f3f21cec1b44c097ea10d8337f3960dc8b4bb7.tar.bz2 gentoobrowse-api-c1f3f21cec1b44c097ea10d8337f3960dc8b4bb7.tar.xz gentoobrowse-api-c1f3f21cec1b44c097ea10d8337f3960dc8b4bb7.zip |
Add make file for updating schema
-rw-r--r-- | gentoobrowse-api/db/database.mk | 13 |
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 $@ + |