13 lines
393 B
Ruby
13 lines
393 B
Ruby
class DropContextCodeFromRoleOverride < ActiveRecord::Migration
|
|
def self.up
|
|
remove_index :role_overrides, :context_code
|
|
remove_column :role_overrides, :context_code
|
|
end
|
|
|
|
def self.down
|
|
add_column :role_overrides, :context_code, :string
|
|
add_index :role_overrides, :context_code
|
|
RoleOverride.update_all("context_code=LOWER(context_type) || '_' || context_id")
|
|
end
|
|
end
|