From ba66108f5448552a645ebf7bf19df5affbc31952 Mon Sep 17 00:00:00 2001 From: randomdan Date: Tue, 7 Jan 2014 23:13:25 +0000 Subject: Makefile scripts for updating schema/database --- p2pvr/datasources/database.mk | 11 +++++++++++ p2pvr/datasources/schema.mk | 5 +++++ 2 files changed, 16 insertions(+) create mode 100644 p2pvr/datasources/database.mk create mode 100644 p2pvr/datasources/schema.mk diff --git a/p2pvr/datasources/database.mk b/p2pvr/datasources/database.mk new file mode 100644 index 0000000..847e09e --- /dev/null +++ b/p2pvr/datasources/database.mk @@ -0,0 +1,11 @@ +.PHONY : database current.sql schema.sql + +database: patch.sql + psql -U p2pvr p2pvr < $< + +current.sql : + pg_dump -U p2pvr p2pvr -O -s -E utf8 > $@ + +patch.sql : current.sql schema.sql + apgdiff --add-transaction current.sql schema.sql | tee $@ + diff --git a/p2pvr/datasources/schema.mk b/p2pvr/datasources/schema.mk new file mode 100644 index 0000000..8e8a083 --- /dev/null +++ b/p2pvr/datasources/schema.mk @@ -0,0 +1,5 @@ +.PHONY : schema.sql + +schema.sql : + pg_dump -U p2pvr p2pvr -O -s -E utf8 > $@ + -- cgit v1.2.3