Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration failed #214

Closed
runlevel5 opened this issue Apr 15, 2014 · 2 comments · Fixed by #215
Closed

Migration failed #214

runlevel5 opened this issue Apr 15, 2014 · 2 comments · Fixed by #215

Comments

@runlevel5
Copy link
Contributor

when running

bundle exec rake db:migrate

I got

DEPRECATION WARNING: Calling #find(:all) is deprecated. Please call #all directly instead. (called from change at /Users/trung_le/Sites/scirate3/db/migrate/20120426045036_add_subscriber_cache_to_feed.rb:6)
DEPRECATION WARNING: Relation#all is deprecated. If you want to eager-load a relation, you can call #load (e.g. `Post.where(published: true).load`). If you want to get an array of records from a relation, you can call #to_a (e.g. `Post.where(published: true).to_a`). (called from change at /Users/trung_le/Sites/scirate3/db/migrate/20120426045036_add_subscriber_cache_to_feed.rb:6)
rake aborted!

PG::UndefinedColumn: ERROR:  column feeds.position does not exist
LINE 1: SELECT "feeds".* FROM "feeds"   ORDER BY "feeds".position AS...
@runlevel5
Copy link
Contributor Author

This is due to the fact that the column position was added later and calling update_counters would complain. The workaround is to create faux model.

@ghost
Copy link

ghost commented Apr 16, 2014

Thanks for compressing them. If you're setting up a new database you can also run rake db:setup instead of migrate, which will use the schema directly

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant