Sha256: 31f605285a4dba359ecd7025407fc4084a9677cb8db04cb6d72ff733ab3c70d5
Contents?: true
Size: 487 Bytes
Versions: 1
Compression:
Stored size: 487 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 create_table :user_roles, :id => false, :force => true do |t| t.integer :role_id, :user_id end add_index :user_roles, :role_id add_index :user_roles, :user_id r = Role.create(:name => 'admin') end def self.down drop_table :roles drop_table :roles_users end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
role_on-0.2.7 | generators/role_on/templates/db/migrate/migration.rb |