Hi everybody,
i'm a rails newbie and i'm trying to convert an existing application
to rails.
What i cannot find is a way to "convert" an existing mysql database
into a rails migration script. I don't wanto to rewrite all the
migration scripts and i wonder if there's a way to automate this
process.
For example, in Symfony once you have configured an access to a mysql
DB in the config file (config/database.yml) you can launch
# symfony propel-build-schema xml
to generate an the XML file (config/schema.xml) containing the db
structure and after that with
# symfony propel-build-model
and
#symfony propel-generate-crud frontend tablename Tablename
you have the complete editable scaffold for the table access
configured.
Is there a similar way to do these kind of things in rails ? Or the
only way is to write by hand all the migration scripts ?
One thing though: I couldn't get the newly created migration file to
work initially. I kept getting an error that said "uninitialized
constant CreateDatabase." I had to rename the migration class
"CreateDataBase".
So the first line of the migration file is now:
class CreateDatabase < ActiveRecord::Migration