def up
hmac_key = Rails.application.credentials.some_name[:key]
safety_assured do
execute <<~SQL
UPDATE table
SET column_name = 'prefix-'::text || encode(hmac(team_id::text, '#{hmac_key}', 'sha256'), 'hex') || '-suffix'::text
SQL
end
end
encode ensures that escaped characters such as \\x are removed from the resulting HMAC.
encode
ensures that escaped characters such as\\x
are removed from the resulting HMAC.