Joined November 2011
·

Mikhail Nikalyukin

Svitla Systems
·
Sevastopol, Ukraine
·
·
·

Posted to Ubuntu 12.10 Rails install over 1 year ago

It's not recommended to install ruby and rails as sudo. It will be better to use some ruby/gem manager(rvm or rbenv).

@rwz Sorry, didn't pay attention that you are using uuid as primary key, good stuff :)

In Rails 4 uuid is a built-in type for postgres. So it would look like this:

class AddGuuidToSites < ActiveRecord::Migration
  def self.up
    add_column :sites, :guuid, :uuid
    add_index :sites, :guuid
  end

  def self.down
    remove_column :sites, :guuid
  end
end
Achievements
475 Karma
39,532 Total ProTip Views