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

13 lines
251 B
Ruby
Raw Permalink Normal View History

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