mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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 b6f75e231c.
13 lines
325 B
Ruby
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
|