データベースの移行方法は2通りあります。 Rails 3で正しい方法はどれですか?Ruby On Railsの移行
class CreateProducts < ActiveRecord::Migration
def self.up
create_table :products do |t|
t.string :title
t.timestamps
end
end
and
class CreateProducts < ActiveRecord::Migration
def self.up
create_table :products do |t|
t.column :name, :string
t.timestamps
end
end
ありがとうございました!
最初のものがデフォルトです。スカホールド時に参照してください – apneadiving
2番目のメリットは何ですか? – joshim5
第2の利点はありません – jshen