woensdag 25 maart 2009

Rails Migration Types

I started to work with Ruby on Rails again, and I noticed that lots of things changed with Rails 2.0. Mostly good things if you get the hang of it. Only to bad old applications need lots of adjustments. One new thing I learned (probably was possible before) is Rails Migrations. At first it didn't seem so useful, but it is actually is. You can generate and update your database completely with migrations, this also means that you can easily switch your DBMS. Which is a really nice feature. Another big pro is the ability to keep easily track of the database changes en easily update different environments (i.e. from development to test and production).

Here a list of Rails Migration Types mapped to MySQL Column Data Types:












Rails Migration SymbolMySQL Data Type
t.binaryblob
t.booleantinyint(1)
t.datedate
t.datetimedatetime
t.decimaldecimal
t.floatfloat
t.integerint(11)
t.stringvarchar(255)
t.texttext
t.timetime
t.timestampdatetime