openjournals / theoj

The Open Journal
http://theoj.org
MIT License
129 stars 10 forks source link

fix schema.rb so rake db:setup can complete #263

Closed afomi closed 8 years ago

afomi commented 8 years ago

Hi,

I cloned theoj and tried to run rake db:setup, but ran into errors for:

These fields also appear to referenced in code, so I added them back to schema.rb so the db setup task completes successfully.

arfon commented 8 years ago

Hrm, not sure why this is out of sync. What happens if you run rake db:migrate on a fresh install?

afomi commented 8 years ago

Hi @arfon, I saw the errors on a fresh install.

The schema.rb does not contain submitted_at, location, or user_id, but they are referenced in seeds.rb.

afomi commented 8 years ago

I tried rake db:drop db:create db:migrate, and it was successful.

But then I get an error on rake db:seed.

(Which I interpret as the same symptom and cause - the missing fields on Paper, in schema.rb)

arfon commented 8 years ago

Ah OK, thanks for spotting this @afomi. It seems like the seeds are out of date (i.e. they're referencing columns that have since been changed). Looking at schema.rb I believe these are the correct mappings for the seed data:

submitted_at -> created_at
location -> document_location
user_id -> submittor_id
arfon commented 8 years ago

...also, since this isn't an issue with the actual schema (i.e. the schema is correct) I'm going to close this. Feel free to suggest some changes to the seed data - it sounds like we haven't been keeping that up to date :-\