开发者

Easiest way to port a data model to Rails migration

开发者 https://www.devze.com 2023-02-03 01:52 出处:网络
I have designed a data model which has almost 24 tables. I have finished specifying the relation开发者_JAVA技巧s and all the data types are finalized. Now, I want to convert it to migrations in Rails.

I have designed a data model which has almost 24 tables. I have finished specifying the relation开发者_JAVA技巧s and all the data types are finalized. Now, I want to convert it to migrations in Rails.

I have all the scripts ready for it to be created in MySQL. Is there any tool that converts all the table creation queries into a single Rails migration file?

Thanks


I haven't done it myself but according to this post on the ruby forums

rake db:schema:dump

should be sufficient (delete the schema.rb beforehand).

The almost same question here on SO: Ruby / Rails - Reverse Migration - DDL to Ruby Code

0

精彩评论

暂无评论...
验证码 换一张
取 消