Skip to content

Commit dec06f7

Browse files
committed
fix: set default locale for active_storage_attachments column
1 parent bc40a1e commit dec06f7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

db/migrate/20250829000000_add_locale_to_active_storage_attachments.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class AddLocaleToActiveStorageAttachments < ActiveRecord::Migration[7.1]
77
# rubocop:disable Metrics/MethodLength
88
def up
99
# Step 1: add nullable column so deploy can be staged
10-
add_column :active_storage_attachments, :locale, :string
10+
add_column :active_storage_attachments, :locale, :string, default: I18n.default_locale.to_s
1111

1212
# Step 2: backfill existing rows to default locale in one SQL update
1313
say_with_time("Backfilling active_storage_attachments.locale to default locale") do

0 commit comments

Comments
 (0)