5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-05-17 06:50:49 +00:00

fix: change migration methods to add token to roles #13903

This commit is contained in:
jazzari 2023-08-15 16:14:34 -03:00
parent f2236bb305
commit a098e1baa7
2 changed files with 9 additions and 9 deletions

View file

@ -1,6 +1,12 @@
class AddTokenToRoles < ActiveRecord::Migration[6.1]
def change
add_column :roles, :token, :text
Rol.find_each { |m| m.update_column( :token, SecureRandom.hex(64) ) }
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

View file

@ -1,6 +0,0 @@
class ChangeTokenName < ActiveRecord::Migration[6.1]
def change
rename_column :roles, :token, :token_cyphertext
Rol.find_each { |m| m.update_column( :token_cyphertext, SecureRandom.hex(64) ) }
end
end