mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-02-07 20:18:16 +00:00
54a1694637
We switched to negative integers for seeded prompts, but we also need to delete the old ones using IDs 1/2/3 if they exist, or deploys will fail due to the unique index on the name column.
19 lines
399 B
Ruby
19 lines
399 B
Ruby
# frozen_string_literal: true
|
|
|
|
class DeleteDuplicatedSeededPrompts < ActiveRecord::Migration[7.0]
|
|
def up
|
|
DB.exec <<~SQL
|
|
DELETE FROM completion_prompts
|
|
WHERE (
|
|
(id = 1 AND name = 'translate') OR
|
|
(id = 2 AND name = 'generate_titles') OR
|
|
(id = 3 AND name = 'proofread')
|
|
)
|
|
SQL
|
|
end
|
|
|
|
def down
|
|
raise ActiveRecord::IrreversibleMigration
|
|
end
|
|
end
|