summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--p2pvr/datasources/database.mk11
-rw-r--r--p2pvr/datasources/schema.mk5
2 files changed, 16 insertions, 0 deletions
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 > $@
+