0

次の移行で Rails 3.2 を使用しており、created_at/updated_at の両方が生成されます。t.timestamps を追加したことが、これらの列が生成された原因であるという印象を受けました。

class CreateContactsCountries < ActiveRecord::Migration
  def change
    create_table :contacts_countries do |t|
      t.string :name, :official_name, :null => false
      t.string :alpha_2_code, :null => false, :limit => 2
      t.string :alpha_3_code, :null => false, :limit => 3
    end

    add_index :contacts_countries, :alpha_2_code
  end
end
4

1 に答える 1

0

テーブルを削除して再度確認してください。

By default, the generated migration will include t.timestamps (which creates 
the updated_at and created_at columns that are automatically populated 
by Active Record).

これを参照

于 2012-12-05T12:56:40.233 に答える