Add DB migration update script

This commit is contained in:
Joshua Boniface 2020-02-15 23:23:09 -05:00
parent 760805fec1
commit c67fc05219
2 changed files with 13 additions and 0 deletions

13
gen-api-migrations Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
# Generate the database migration files
VERSION="$( head -1 debian/changelog | awk -F'[()-]' '{ print $2 }' )"
pushd api-daemon
./pvcapid-manage.py db migrate -m "PVC version ${VERSION}"
./pvcapid-manage.py db upgrade
git reset
git add migrations
git commit -v "[gen-api-migrations] New database migration"
popd