Merge branch 'develop' into feat/voice-as-twilio-capability
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
class AddSecretToAgentBots < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
add_column :agent_bots, :secret, :string
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddSecretToChannelApi < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
add_column :channel_api, :secret, :string
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,15 @@
|
||||
class BackfillAgentBotAndChannelApiSecrets < ActiveRecord::Migration[7.1]
|
||||
def up
|
||||
AgentBot.where(secret: nil).find_each do |agent_bot|
|
||||
agent_bot.update!(secret: SecureRandom.urlsafe_base64(24))
|
||||
end
|
||||
|
||||
Channel::Api.where(secret: nil).find_each do |channel|
|
||||
channel.update!(secret: SecureRandom.urlsafe_base64(24))
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
# no-op: removing the columns in the previous migrations handles cleanup
|
||||
end
|
||||
end
|
||||
@@ -131,6 +131,7 @@ ActiveRecord::Schema[7.1].define(version: 2026_03_26_120001) do
|
||||
t.bigint "account_id"
|
||||
t.integer "bot_type", default: 0
|
||||
t.jsonb "bot_config", default: {}
|
||||
t.string "secret"
|
||||
t.index ["account_id"], name: "index_agent_bots_on_account_id"
|
||||
end
|
||||
|
||||
@@ -413,6 +414,7 @@ ActiveRecord::Schema[7.1].define(version: 2026_03_26_120001) do
|
||||
t.string "hmac_token"
|
||||
t.boolean "hmac_mandatory", default: false
|
||||
t.jsonb "additional_attributes", default: {}
|
||||
t.string "secret"
|
||||
t.index ["hmac_token"], name: "index_channel_api_on_hmac_token", unique: true
|
||||
t.index ["identifier"], name: "index_channel_api_on_identifier", unique: true
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user