Travis CI “rake db:migrate” or “rake db:test:prepare” causes rake aborted! PG::Error: ERROR: relation “settings” does not exist

StackOverflow https://stackoverflow.com/questions/11826273

سؤال

The relevant travis-ci build is at: http://travis-ci.org/#!/NZOI/nztrain/builds/2046207

At that point neither db:migrate or db:test:prepare commands work. I have checked that the db/schema.rb file is there, so it should just be able to load the schema into the database.

Github code also available from https://github.com/NZOI/nztrain/tree/a710ef72089ae589a53a7ca0187f73e7f9bf4cc0

هل كانت مفيدة؟

المحلول

Error caused by:

  • rake db:??? runs initializers
  • initializer accessed a table, pulling settings stored in the database table called "settings"
  • travis-ci starts without any tables in db

Because initializers run before db:?? has a change to create the tables, error occurs

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top