mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
16 lines
301 B
Ruby
16 lines
301 B
Ruby
class RefactorRoles < ActiveRecord::Migration
|
|
def up
|
|
add_column :users, :roles, :string, array: true
|
|
|
|
User.all.each do |x|
|
|
x.roles = ['admin']
|
|
x.save
|
|
end
|
|
|
|
remove_column :users, :role_id
|
|
|
|
drop_table :roles
|
|
drop_table :rights
|
|
drop_table :rights_roles
|
|
end
|
|
end
|