Posts [ 8 ]

Topic: Should we generate models for an existing MySQL database with data?

I've been working through the many examples of how one uses 'generate' model to create the model.rb and the migrate and fixtures file.It occured to me that maybe I should manually create these as the whenever I start the production application it will already have customer data in it (as I converted their old legacy system)and I won't be creating the database schema.I'm thinking now that I should take all of the existing migrate files and consolidate them into one? Then I'll manually create all of the model.rb files and fixtures.Is this how you start up an application with an existing database? RyanB are you there?David

Re: Should we generate models for an existing MySQL database with data?

It is not likely your legacy database schema fits into Rails conventions. If it were me, I would recreate the database from scratch along with the Rails app so I can stick to Rails conventions and improve the structure of the database while I'm at it.

Re: Should we generate models for an existing MySQL database with data?

Ryan,The point of all this is "should I manually create the model.rb and fixture.rb because I'm NOT going to be running a db:migrate because the fully loaded MySQL database will ALWAYS be delivered to the application.I won't be using any migrations to deliver my application. Yes, as it evolves certainly I'll be using migrates but NOT precedent to delivery.David