데이터베이스를 마이그레이션하는 두 가지 다른 방법을 보았습니다. 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
두 번째 장점은 무엇입니까? – joshim5
두 번째에는 아무런 이점이 없습니다. – jshen