mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-14 23:31:41 +00:00
16 lines
335 B
Ruby
16 lines
335 B
Ruby
class AddApiKeyToSites < ActiveRecord::Migration[6.0]
|
|
def up
|
|
add_column :sites, :api_key_ciphertext, :string
|
|
|
|
begin
|
|
Site.find_each do |site|
|
|
site.update_attribute :api_key, SecureRandom.hex(64)
|
|
end
|
|
rescue Errno::ENOENT
|
|
end
|
|
end
|
|
|
|
def down
|
|
remove_column :sites, :api_key_ciphertext
|
|
end
|
|
end
|