diff options
author | randomdan <randomdan@localhost> | 2014-01-07 23:13:25 +0000 |
---|---|---|
committer | randomdan <randomdan@localhost> | 2014-01-07 23:13:25 +0000 |
commit | ba66108f5448552a645ebf7bf19df5affbc31952 (patch) | |
tree | f440105984e3c4c6cc52880f9af39c8048af1005 | |
parent | Select a remmeber the scheduleId for an upcoming recording (diff) | |
download | p2pvr-ba66108f5448552a645ebf7bf19df5affbc31952.tar.bz2 p2pvr-ba66108f5448552a645ebf7bf19df5affbc31952.tar.xz p2pvr-ba66108f5448552a645ebf7bf19df5affbc31952.zip |
Makefile scripts for updating schema/database
-rw-r--r-- | p2pvr/datasources/database.mk | 11 | ||||
-rw-r--r-- | p2pvr/datasources/schema.mk | 5 |
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 > $@ + |