Question

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 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?

Was it helpful?

Solution

Have you tried a rake db:dump ?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top