Sha256: b2023ee90921bf7c89755951ebf189145b9685b78f23c6d220f50e0ccb2167d8

Contents?: true

Size: 449 Bytes

Versions: 12

Compression:

Stored size: 449 Bytes

Contents

class SetupRoleOn < ActiveRecord::Migration
  def self.up
    create_table :roles, :force => true do |t|
      t.string :name
      t.timestamps
    end

    add_index :roles, ['name'], :name => 'index_roles_on_name'

    create_table :user_roles, :id => false, :force => true do |t|
      t.integer :role_id, :user_id
    end

    r = Role.create(:name => 'admin')
  end

  def self.down
    drop_table :roles
    drop_table :roles_users
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
darkhelmet-role_on-0.1.1 generators/role_on/templates/db/migrate/migration.rb
darkhelmet-role_on-0.1.2 generators/role_on/templates/db/migrate/migration.rb
darkhelmet-role_on-0.1.3 generators/role_on/templates/db/migrate/migration.rb
darkhelmet-role_on-0.1.4 generators/role_on/templates/db/migrate/migration.rb
darkhelmet-role_on-0.2.0 generators/role_on/templates/db/migrate/migration.rb
darkhelmet-role_on-0.2.1 generators/role_on/templates/db/migrate/migration.rb
darkhelmet-role_on-0.2.2 generators/role_on/templates/db/migrate/migration.rb
darkhelmet-role_on-0.2.3 generators/role_on/templates/db/migrate/migration.rb
darkhelmet-role_on-0.2.4 generators/role_on/templates/db/migrate/migration.rb
darkhelmet-role_on-0.2.5 generators/role_on/templates/db/migrate/migration.rb
darkhelmet-role_on-0.2.6 generators/role_on/templates/db/migrate/migration.rb
darkhelmet-role_on-0.2.7 generators/role_on/templates/db/migrate/migration.rb