Learning to Migrate

I really didn’t value the database migration in Rails until I became enlightened in Rails Studio. I manually created the database and let Rails get the schema. This is the reason why you’ll see that my primary keys in databases are not named “id” but includes the table name.

The primary reason for not doing migration was I still am not willing to learn a new ways of doing things. I didn’t really trust this whole ORM thing and it made me nervous. I see the benefits now that I opened my eyes. When I create a model, I now do:

script/generate model some_table field1:string field2:integer
rake db:migrate

I still check the database to see if everything has been created out of habit, but I like the fact that I can now have a version control and truly use ORM.

Comments

Comments are closed.

Powered by Olark