]> git.donarmstrong.com Git - wannabuild.git/blob - schema/update-schema.sh
Auto-committed schema changes.
[wannabuild.git] / schema / update-schema.sh
1 #!/bin/sh
2
3 # Dump the schema.
4 pg_dump --cluster 8.4/wanna-build -s wanna-build > wanna-build.sql
5 git add wanna-build.sql
6
7 # Dump the roles.
8 sudo -u postgres pg_dumpall --cluster 8.4/wanna-build | egrep '^(GRANT.*TO.*BY|CREATE ROLE)' > roles.sql
9 git add roles.sql
10
11 git status >/dev/null && git commit wanna-build.sql roles.sql -m 'Auto-committed schema changes.'
12 git push >/dev/null
13