This project is archived and is in readonly mode.

#6336 ✓stale
rgoytacaz (at gmail)

Rake tasks are weird in 3.0.3 (db:migrate/setup)

Reported by rgoytacaz (at gmail) | January 26th, 2011 @ 04:31 PM

Hello there,

Ruby 1.9.2
Rails 3.0.3

I got a model like this;

class PdVersion < ActiveRecord::Base

  belongs_to :transportation
  has_many :cenarios
  has_many :users

  scope :least_users, find_by_sql("SELECT \"pd_versions\".* FROM \"pd_versions\" WHERE (outlying = 't' AND line_qty = 1 AND users_count = (SELECT MIN(users_count) from \"pd_versions\") )").first

when I run db:migrate it tells me that the pd_versions table was not found. So I assume for some weird reason, db:migrate is trying to run my scope there, which is a lot of weirdness.

Another thing is, db:setup, which was supposed to be db:migrate + db:seed right? Well when you run it, db:setup doesn't recreate the schema.rb, it keeps the same file so the migration (if you changed a migration, I know its a bad practice) it wont reflect the latest changes.

[]'s Rodrigo Dellacqua

Edited by Rohit Arondekar for formatting.

Comments and changes to this ticket

  • Rohit Arondekar

    Rohit Arondekar January 27th, 2011 @ 06:45 AM

    • Importance changed from “” to “Low”

    Rodrigo could you please also show the code generated in the migration? I'm guessing the reason for the error will be in there.

  • rails

    rails April 29th, 2011 @ 01:00 AM

    • State changed from “new” to “open”
    • Tag changed from rake tasks db:migrate db:setup to rake tasks dbmigrate dbsetup

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

  • rails

    rails April 29th, 2011 @ 01:00 AM

    • State changed from “open” to “stale”

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>