Hi Felix,

Sometimes migrations fail for me if I add a field and use the business  
logic in the model to populate the fields. Or an earlier migration  
uses some model logic that is changed at a later time.

But definitely not the norm.

Maybe putting the logging code in a rescue block?

Some people say migrations are for incremental and schema.rb is for  
building a complete system.

Personally I prefer using migrations.

Once you get near 100, you can use the schema.rb to create a mega  
migration and delete all the old migrations. If that is a concern. It  
is quicker.


When you are hacking around, I've seen people dump/create. Only use  
case I've experienced

Have not found Heroku migrations that different from local. But I can  
imagine how it might be.

Best of luck and keep on coding away
--Keenan

On Feb 24, 2009, at 4:03 PM, Felix Holmgren <[email protected]>  
wrote:

> I added a table (Debug) to my app, and created rows in it in an  
> initializer script. When I pushed it to Heroku I couldn't run rake  
> db:migrate, because Heroku first wanted to initialize the  
> environment, and since the initialization tried to access the table  
> that was about to be created, the migration failed. Very frustrating.
>
> I had to first comment out the line that used the table, push to  
> heroku, then migrate. I have not encountered this problem before,  
> neither locally nor on my former host. Unless I have failed to see  
> something obvious (which is quite likely), I would say this ranks as  
> a bug.
>
> Please enlighten me.
>
> Also, what is the proper thing to do after pushing code that adds  
> new migrations? Running db:migrate? Or db:schema:load? (Having first  
> dumped schema.rb locally and checked it in.)
>
> Is it ever necessary/proper to execute db:drop or db:create?
>
> The db migrations have been the trickiest part of my Heroku  
> experience so far.
>
> Felix
>
> >

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to