I have a rails application on openshift. I want to run rake db:migrate
in a deploy hook on openshift, except on first deploy, when I want to run rake db:setup
.
This is not necessarily openshift-specific, since deploy hooks are just bash scripts which run when the application is deployed.
Is there any way of knowing if the application has been deployed before or whether the database has already been created from a deploy hook?