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