May 6th, 2007

So migrations are brining sexy back…ok, I promise never to mention a JTimb song again on this blog, but it’s true. As of 6667, migrations got a bit of err inspiration. What use to look like this…

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

now can look like this…

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

Very nice. Can’t wait to try it out.

Posted by jnunemaker in Core

3 Responses to “Sexy Migrations”

  1. for the record, referring to him as JTimb is far worse than referencing lyrics in one of his songs.

    bye ... bye bye

  2. @Harle – True.

    @Ryan – Nice. Don’t worry, I have no intentions of treading on your “What’s new…” articles. I promise to only do it when I find the changeset particularly interesting. :)

Sorry, comments are closed for this article to ease the burden of pruning spam. If you have any further comments, just send me an email.

About

Authored by John Nunemaker (Noo-neh-maker), a web developer/programmer who has fallen deeply in love with Ruby.

Syndication

Feed IconRailsTips Articles - An assortment of howto's and thoughts on Ruby and Rails.

Feed IconRails Quick Tips - Ruby and Rails related links that I find. Never more than 5 a day.

Search