15 lines
411 B
Ruby
15 lines
411 B
Ruby
class DropContextCodeFromRoleOverride < ActiveRecord::Migration
|
|
tag :predeploy
|
|
|
|
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
|