开发者

rake db:migrate wipes out my database

开发者 https://www.devze.com 2023-02-05 04:41 出处:网络
I have an app that I\'m porting from PHP/symfony to Ruby/Rails. Though the language is changing, there is no need to modify the database (MySQL) in any way.

I have an app that I'm porting from PHP/symfony to Ruby/Rails. Though the language is changing, there is no need to modify the database (MySQL) in any way.

Because I already have my database defined, there's no reason for me to individually create a Rails model for each table and manually specify the attributes of each model. Given the size of my database, that would be ridiculous.

Because I don't need to individually create models, my schema.yml is blank. Because schema.yml开发者_JAVA技巧 is blank, running rake db:migrate will wipe out my database. (At least I think that's the reason. I could be wrong.)

Can anyone recommend a way of handling this situation where I have an existing database but I don't want to manually re-define every single table for Rails?


Have you tried a rake db:dump ?

0

精彩评论

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