5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 11:26:21 +00:00
panel/db/migrate/20230731195050_add_token_to_roles.rb

12 lines
251 B
Ruby

class AddTokenToRoles < ActiveRecord::Migration[6.1]
def up
add_column :roles, :token, :string
Rol.find_each do |m|
m.update_column( :token, SecureRandom.hex(64) )
end
end
def down
remove_column :roles, :token
end
end