5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-14 23:41:43 +00:00
panel/db/migrate/20200810230944_add_priv_key_to_sites.rb

16 lines
381 B
Ruby

# frozen_string_literal: true
# Agrega las llaves privadas cifradas a cada sitio
class AddPrivKeyToSites < ActiveRecord::Migration[6.0]
def up
add_column :sites, :private_key_ciphertext, :string
Site.find_each do |site|
site.update_attribute :private_key, Lockbox.generate_key
end
end
def down
remove_column :sites, :private_key_ciphertext
end
end