Rails-2.0以降に追加されたmigrationの記法についてまとめておきます。
t.<data_type>という書き方が可能になった。t.string :foo, :bar, :bazのように併記もOKt.timestamcreated_atps , updated_at を追加 t.referencでes :foo foo_idを追加。:polymorphオプションをつけると、ic => true foo_typeカラムも追加される。
posted by
genki
on Tue 17 Jun 2008
at 11:18


