Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions db/migrate/20250522045138_cleanup_amazon_translations.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# frozen_string_literal: true

class CleanupAmazonTranslations < ActiveRecord::Migration[7.2]
def up
provider =
DB.query_single("SELECT value FROM site_settings WHERE name = 'translator_provider'").first
if provider == "Amazon"
execute <<~SQL
DELETE FROM discourse_translator_post_translations
WHERE translation LIKE '{:translated_text%'
SQL

execute <<~SQL
DELETE FROM discourse_translator_topic_translations
WHERE translation LIKE '{:translated_text%'
SQL
end
end

def down
end
end
Loading