2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-31 00:06:56 -04:00
|
|
|
class AddIndexToPostCustomFields < ActiveRecord::Migration[4.2]
|
2015-07-27 20:50:02 -04:00
|
|
|
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
|
2015-07-24 12:53:51 -04:00
|
|
|
end
|
|
|
|
end
|