I use Capistrano for deployment for production for the first time and I get an error message when I start
cap production deploy
Mistake:
** Invoke deploy:migrate (first_time)
** Invoke deploy:set_rails_env
** Execute deploy:migrate
DEBUG [048f89c6] Running /usr/bin/env if test ! -d /home/deployer_user/apps/ap_production/releases/20140209005208; then echo "Directory does not exist '/home/deployer_user/apps/ap_production/releases/20140209005208'" 1>&2; false; fi on eslope.net
DEBUG [048f89c6] Command: if test ! -d /home/deployer_user/apps/ap_production/releases/20140209005208; then echo "Directory does not exist '/home/deployer_user/apps/ap_production/releases/20140209005208'" 1>&2; false; fi
DEBUG [048f89c6] Finished in 0.160 seconds with exit status 0 (successful).
INFO [52f75214] Running ~/.rbenv/bin/rbenv exec bundle exec rake db:migrate on eserver.net
DEBUG [52f75214] Command: cd /home/deployer_user/apps/ap_production/releases/20140209005208 && ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.1.0 RAILS_ENV=production ~/.rbenv/bin/rbenv exec bundle exec rake db:migrate )
DEBUG [52f75214] rake aborted!
DEBUG [52f75214] An error has occurred, this and all later migrations canceled:
DEBUG [52f75214]
DEBUG [52f75214] PG::UndefinedTable: ERROR: relation "client_infos" does not exist
DEBUG [52f75214] : ALTER TABLE "client_infos" RENAME TO "clients
The mistake really makes sense. Link table does not exist. I don’t understand why migration works at all? Why the database is not created from the schema at the first start. I accidentally deleted a file that says which migrations were performed? Either just deleting it, or ".gitignoring"?
, , (rake db: create or similar), , Capistrano v3 , , ? , , , , , ... ( , , , ?) .