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