mirror of
https://github.com/discourse/discourse.git
synced 2024-12-02 05:29:17 -06:00
15 lines
327 B
Ruby
15 lines
327 B
Ruby
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
|