2009/8/31 zambezi <[email protected]>:
>
> I've encountered a problem running Rake migrations.  This is in a
> fresh database (no prior migrations run).
>
> 001_create_incident_users
> 002_create_incidents
>
> Running db:migration resulted in table incident_users being
> successfully created, but Rake then aborted before migrating/creating
> the second table.
>
> So I then tried the following three permutations to coax a successful
> migration of the incident table and got the same result each time.
> Basically an incident_user migration is run (rather than incident) and
> then the process aborts.  The log file didn't have anything further to
> offer.
>
> db:migration
> db:migration incidents
> db:migration VERSION=002
>
> (in C:/RubyRails/rails_apps/rappEAHv8)
> == 2 CreateIncidentUsers: migrating
> ===============================================
> -- create_table(:incident_users)
> rake aborted!
> Mysql::Error: Table 'incident_users' already exists:
>

This sort of thing is unfortunately not that uncommon.  The issue is
that the migration failed for some reason half way through, after
creating the incident_users table but before completeing the
migration.  When you run the migration again it starts from the
beginning of the file and attemts to create the table, but it already
exists hence the error.
If you delete the incident_users table manually then try again you
will get the original error message again which may tell you more.

Colin

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" 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/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to