mysql - Migrate old php site database to rails with legacy script and mantain old ids -


i'm trying migrate old php website database (mysql) rails 3 app (mysql) rake legacy script this:

how migrate legacy php mysql data new rails data model?

but have problem:
- old table id's lost because if have table
id | field
1 | field_value
2 | field_value 2
4 | field_value 4

using model.create(....) becomes:

id | field
1 | field_value
2 | field_value 2
3 | field_value 4

how can migrate using model.create(....) , mantaining old id's?

have here: overriding id on create in activerecord

also, consider dumping , importing whole database. can make rails specific modifications data later migrations.


Comments