eBooru/db/migrate/20220219202441_set_user_text_defaults.rb
Earlopain fc7d84affd
[RuboCop] Enable Style/FrozenStringLiteralComment
This reduces allocations on the posts page by about 5%, from basic testing
2024-02-25 18:15:55 +01:00

13 lines
427 B
Ruby

# frozen_string_literal: true
class SetUserTextDefaults < ActiveRecord::Migration[6.1]
def up
change_column :users, :profile_about, :text, default: ""
change_column :users, :profile_artinfo, :text, default: ""
User.without_timeout do
User.where(profile_about: nil).in_batches.update_all(profile_about: "")
User.where(profile_artinfo: nil).in_batches.update_all(profile_artinfo: "")
end
end
end