Sha256: f9a11e958a7a8926fbd482680652745942945294776c74fc9a40d5a56add6977

Contents?: true

Size: 576 Bytes

Versions: 7

Compression:

Stored size: 576 Bytes

Contents

class CreateRoles < ActiveRecord::Migration
  def self.up
    create_table :roles do |t|

      t.string :name,        :null => false
      t.string :title,       :null => false
      t.text   :description, :null => false
      #Use Postgresql's native json
      #Remove this test if you using PostgreSQL prior to 9.2
      if   ::ActiveRecord::Base.connection.adapter_name == 'PostgreSQL'
        t.json :the_role, :null => false
      else
        t.text :the_role, :null => false
      end

      t.timestamps
    end
  end

  def self.down
    drop_table :roles
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
the_role-2.5.4 db/migrate/20111025025129_create_roles.rb
the_role-2.5.3 db/migrate/20111025025129_create_roles.rb
the_role-2.5.2 db/migrate/20111025025129_create_roles.rb
the_role-2.5.1 db/migrate/20111025025129_create_roles.rb
the_role-2.5 db/migrate/20111025025129_create_roles.rb
the_role-2.4 db/migrate/20111025025129_create_roles.rb
the_role-2.3 db/migrate/20111025025129_create_roles.rb