mirror of
https://github.com/discourse/discourse.git
synced 2025-02-05 19:11:13 +00:00
This reduces chances of errors where consumers of strings mutate inputs and reduces memory usage of the app. Test suite passes now, but there may be some stuff left, so we will run a few sites on a branch prior to merging
17 lines
358 B
Ruby
17 lines
358 B
Ruby
# frozen_string_literal: true
|
|
|
|
class AddIndexToPostCustomFields < ActiveRecord::Migration[4.2]
|
|
def up
|
|
execute <<SQL
|
|
CREATE INDEX index_post_custom_fields_on_name_and_value ON post_custom_fields USING btree (name, left(value, 200))
|
|
SQL
|
|
end
|
|
|
|
def down
|
|
execute <<SQL
|
|
DROP INDEX index_post_custom_fields_on_name_and_value
|
|
SQL
|
|
|
|
end
|
|
end
|