mirror of https://github.com/docusealco/docuseal
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
457 B
22 lines
457 B
# frozen_string_literal: true
|
|
|
|
class AddSecretToWebhookUrls < ActiveRecord::Migration[7.2]
|
|
class MigrationWebhookUrl < ApplicationRecord
|
|
self.table_name = 'webhook_urls'
|
|
|
|
serialize :secret, coder: JSON
|
|
|
|
encrypts :url, :secret
|
|
end
|
|
|
|
def change
|
|
add_column :webhook_urls, :secret, :text
|
|
|
|
MigrationWebhookUrl.all.each do |url|
|
|
url.update_columns(secret: {})
|
|
end
|
|
|
|
change_column_null :webhook_urls, :secret, false
|
|
end
|
|
end
|