discourse/db/migrate/20230127173249_truncate_user_status_to_100_characters.rb
Bianca Nenciu 23a74ecf8f
FIX: Truncate existing user status to 100 chars (#20044)
This commits adds a database migration to limit the user status to 100
characters, limits the user status in the UI and makes sure that the
emoji is valid.

Follow up to commit b6f75e231cb49455908c980e0549290828c2162f.
2023-01-30 10:49:08 +02:00

13 lines
325 B
Ruby

# frozen_string_literal: true
class TruncateUserStatusTo100Characters < ActiveRecord::Migration[7.0]
def up
execute "UPDATE user_statuses SET description = left(description, 100)"
execute "UPDATE user_statuses SET emoji = left(emoji, 100)"
end
def down
raise ActiveRecord::IrreversibleMigration
end
end