Forum: Ruby on Rails Issue with version field in schema_info

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
9f4e11fd04ca1e5a56d00ff3531104ed?d=identicon&s=25 Jean Nibee (jeannibee)
on 2007-07-09 03:51
(I know 'version' is the only field, but in case this changed one day my
question will still apply) ;)

I had to drop all my tables to re-run my migrations from version 1. When
I executed 'rake db:migrate' everything ran successfully. Which puts my
database 'state' at migration 007_xxx.

Now when I add a migration (008_xxx) and re-run 'rake db:migrate' I got
an error saying the table being create in migration 001_xxx already
exists.

When I checked the table "select * from schema_info" there was nothing
in the table. Inserting the proper version number by hand and re-running
my migrate worked and migration 008 worked. All 'rake db:migrate' being
run from here update the table successfully.

I can re-create this 100% of the time.

Comments?
9f4e11fd04ca1e5a56d00ff3531104ed?d=identicon&s=25 Jean Nibee (jeannibee)
on 2007-07-09 19:54
Jean Nibee wrote:
> (I know 'version' is the only field, but in case this changed one day my
> question will still apply) ;)
>
> I had to drop all my tables to re-run my migrations from version 1. When
> I executed 'rake db:migrate' everything ran successfully. Which puts my
> database 'state' at migration 007_xxx.
>
> Now when I add a migration (008_xxx) and re-run 'rake db:migrate' I got
> an error saying the table being create in migration 001_xxx already
> exists.
>
> When I checked the table "select * from schema_info" there was nothing
> in the table. Inserting the proper version number by hand and re-running
> my migrate worked and migration 008 worked. All 'rake db:migrate' being
> run from here update the table successfully.
>
> I can re-create this 100% of the time.
>
> Comments?

/bump

Issue: schema_info not updating / inserting prope migration version
after a 'wipe'   and re-creation of the database.
This topic is locked and can not be replied to.