mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-02-07 12:08:13 +00:00
In some case we may be deploying migrations, seeding and then running post migrations, we need this to work so we give up on this small window of protection
18 lines
620 B
Ruby
18 lines
620 B
Ruby
# frozen_string_literal: true
|
|
|
|
class ToolDetailsAndCommandRemoval < ActiveRecord::Migration[7.0]
|
|
def change
|
|
add_column :ai_personas, :tool_details, :boolean, default: true, null: false
|
|
add_column :ai_personas, :tools, :json, null: false, default: []
|
|
# we can not do this cause we are seeding the data and in certain
|
|
# build scenarios we seed prior to running post migrations
|
|
# this risks potentially dropping data but the window is small
|
|
# Migration::ColumnDropper.mark_readonly(:ai_personas, :commands)
|
|
|
|
execute <<~SQL
|
|
UPDATE ai_personas
|
|
SET tools = commands
|
|
SQL
|
|
end
|
|
end
|