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

WARNING: db:test:prepare is deprecated #52

Open
iainbeeston opened this issue Nov 4, 2014 · 1 comment
Open

WARNING: db:test:prepare is deprecated #52

iainbeeston opened this issue Nov 4, 2014 · 1 comment

Comments

@iainbeeston
Copy link
Contributor

I'm using kicker 3 with rails 4.1, but I'm seeing the following error whenever my schema file changes:

Kicker: rake db:test:prepare

WARNING: db:test:prepare is deprecated. The Rails test helper now maintains your test schema automatically, see the release notes for details.

I suspect the rails recipe is running db:test:prepare when the schema file changes.

@Manfred
Copy link
Collaborator

Manfred commented Nov 4, 2014

Yes, that's correct. Two things of note.

  1. I don't agree with Rails' decision to drop this task. They now ‘maintain’ the schema for you with ActiveRecord::Migration.maintain_test_schema!. This doesn't support switching branches with different sets of migrations because it only reloads the schema when there are pending migrations (e.g. not when the branch is missing migrations compared to the last one).
  2. Not all test frameworks have explicit support for this so they will start failing if we don't load the schema.
  3. Kicker should work with older Rails versions.

A nice solution could be to change this to run rake db:schema:load RAILS_ENV=test, which I think solves most issues.

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

No branches or pull requests

2 participants