Class: SunriseCreateRoles
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- SunriseCreateRoles
- Defined in:
- lib/generators/sunrise/templates/migrate/create_roles.rb
Class Method Summary collapse
Class Method Details
.down ⇒ Object
13 14 15 |
# File 'lib/generators/sunrise/templates/migrate/create_roles.rb', line 13 def self.down drop_table :roles end |
.up ⇒ Object
2 3 4 5 6 7 8 9 10 11 |
# File 'lib/generators/sunrise/templates/migrate/create_roles.rb', line 2 def self.up create_table :roles do |t| t.integer :role_type, :limit => 1, :default => 0 t.integer :user_id, :null => false t. end add_index :roles, :user_id, :name => "fk_user" end |