Re: migration and git

12 views
Skip to first unread message
Message has been deleted

Frederick Cheung

unread,
Dec 5, 2015, 8:20:52 AM12/5/15
to Ruby on Rails: Talk
On Saturday, December 5, 2015 at 1:11:54 PM UTC, Martin wrote:


> - merging master to branch a because of this important changes, so a is ahead of master not just a fork.
> - now I put a copy of the production database to the development database
>
> of course now the migration first created in a is not there, because it never reached master, but because it has a lower number than the last migration in master, rake db:migrate does not do anything.

That doesn't sound right - rake db:migrate runs migrations that have not been run by comparing the contents of the schema_migrations table with the list of available migrations: it doesn't just assume that everything upto the largest entry has been run (unless possibly you are using the legacy pre rails 2 migration numbering scheme - no idea if that is still possible)

The only exception to this is that if you run db:schema:load then it assumes all migrations upto the version named in schema.rb have run.

Fred


> now I tried to give the migration file a newer number, but then rake db:migrate tells me the table created in the migration would be allready there.  but looking directly inside the database it is not there.
>
> What do I miss and how can I fix this?
>
> note: it could also be because i just changed the db schema from sqlite to mysql2.
>
> it seems that rake db:migrate works on the sqlite, not on thy msql table?
>
> Thanks for help,
> Martin

Martin Kaffanke

unread,
Dec 5, 2015, 9:11:04 AM12/5/15
to rubyonra...@googlegroups.com
Thanks, I found it out. I didn't take over the database configuration
to the new branch, so it was my mistake. Thats why i deleted this
message.

Martin
--
Mag. Martin Kaffanke
http://www.kaffanke.at
+43 650 4514224

Reply all
Reply to author
Forward
0 new messages