Carlos Brando
Sep 18, 2007 · 1 min read

Na próxima versão do Rails teremos um jeito novo de criar migrations. Hoje estamos acostumados a fazer assim:

create_table "products" do |t| 
t.column "shop_id", :integer
t.column "creator_id", :integer
t.column "name", :string, :default => "Untitled"
t.column "value", :string, :default => "Untitled"
t.column "created_at", :datetime
t.column "updated_at", :datetime
end

Mas poderemos fazer assim:

create_table :products do |t| 
t.integer :shop_id, :creator_id
t.string :name, :value, :default => “Untitled”
t.timestamps
end

Os dois códigos fazem exatamente a mesma coisa.


Originally published at nomedojogo.com on September 18, 2007.

Nome do Jogo

by Carlos Brando

Carlos Brando

Written by

Programmer, CTO at @enjoei, Author of two books about Ruby on Rails, and Host of the @grokpodcast.

Nome do Jogo

by Carlos Brando

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade