Skip to content

A platform for community discussion. Free, open, simple.

DEV: Drop unused column `translation_overrides.compiled_js`

Loïc Guitautbee82143992e
diff --git a/app/models/translation_override.rb b/app/models/translation_override.rb
index a9d52c28546..23129688b8c 100644
--- a/app/models/translation_override.rb
+++ b/app/models/translation_override.rb
@@ -1,6 +1,11 @@
# frozen_string_literal: true
class TranslationOverride < ActiveRecord::Base
+ # TODO: Remove once
+ # 20240711123755_drop_compiled_js_from_translation_overrides has been
+ # promoted to pre-deploy
+ self.ignored_columns = %w[compiled_js]
+
# Allowlist i18n interpolation keys that can be included when customizing translations
ALLOWED_CUSTOM_INTERPOLATION_KEYS = {
%w[
@@ -216,7 +221,6 @@ end
# value :string not null
# created_at :datetime not null
# updated_at :datetime not null
-# compiled_js :text
# original_translation :text
# status :integer default("up_to_date"), not null
#
diff --git a/db/post_migrate/20240711123755_drop_compiled_js_from_translation_overrides.rb b/db/post_migrate/20240711123755_drop_compiled_js_from_translation_overrides.rb
new file mode 100644
index 00000000000..1476e63cf35
--- /dev/null
+++ b/db/post_migrate/20240711123755_drop_compiled_js_from_translation_overrides.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class DropCompiledJsFromTranslationOverrides < ActiveRecord::Migration[7.1]
+ DROPPED_COLUMNS ||= { translation_overrides: %i[compiled_js] }
+
+ def up
+ DROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) }
+ end
+
+ def down
+ raise ActiveRecord::IrreversibleMigration
+ end
+end