On 12/17/05, Jason E. firstname.lastname@example.org wrote:
I’d like to use migrations to build my initial database. Is there a gem
or plugin that will generate the migration code for initial db if I
point it at a live database or sql file?
It’s built right in. Uncomment the line in config/environment.rb that
config.active_record.schema_format = :ruby
Then run rake db_schema_dump and you’ll have the schema in
db/schema.rb. This can be loaded with rake db_schema_import, or you
can copy the create_table statements into a new migration.
If yes, then can you automatically generate the incremental migrations
No, but if you run your tests db/schema.rb will always be up-to-date.