Incremental DB upgrade in Openshift

As my application is evolving, I need a way to push schema changes to DB in OpenShift without losing existing data. My application uses Node.js and PostgreSQL so I wanted to use node-migrate to manage incremental schema changes. The issue is that node-migrate uses file migrations/.migrate which is deleted with every push to OpenShift (migrations folder contains also migration scripts and is stored in Git repo).

Do you know how to configure node-migrate to work with OpenShift properly?

OR

If you don't know about node-migrate but understand OpenShift, what would be the proper file location where application can write during deploy and file is not deleted during git push?

I'm not very familiar with node-migrate, but the $OPENSHIFT_DATA_DIR (~/app-root/data) is somewhere you can write to and it won't get deleted on a git push.

Your app should handle the DB schema changes itself, it's not a function of Openshift.

django for example, has a command (syncdb) that updates new tables, but does not yet modify existing schemas.

For django, I have tied into the action hooks scripts that allow me to run the sync db command on every deploy. they are just standard shell scripts, and are executed whenever you push your code. there are other action hooks, these are just the ones that I know about.

HTH