PecanProject / pecan

The Predictive Ecosystem Analyzer (PEcAn) is an integrated ecological bioinformatics toolbox.
www.pecanproject.org
Other
203 stars 235 forks source link

Update schema without Rails app #917

Closed dlebauer closed 8 years ago

dlebauer commented 8 years ago

when I run

./load.bety.sh

I get the error

Checking schema : EXPECTED SCHEMA version c4b7e7f3831e7e662626e0b5fab4ecbb Dump is from a different schema, please fix schema in database.

Is there a way to fix the schema in the database without using the rails application to run migrations?

This error also appeared in #600 and #226, but those were focused on errors that occur before the schema is checked.

mdietze commented 8 years ago

I don't think so, nor do I think it's a great idea to hack around that and load data from a database in one schema into an instance that has a different schema -- that's guaranteed to result in conflicts and errors.

robkooper commented 8 years ago

I agree with Mike, you should not synchronize the database without having the correct schema. To migrate the schema you have two options. Options 1, is the only supported way to do this thought:

  1. you either have to have a version of BETY rails installed and do a bundle exec rake db:migrte
  2. (not supported) you can find a machine (VM) that has it installed, rollback the VM and run it again and copy the SQL statements printed back into the other instance.