mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 15:48:43 -05:00
FIX: custom field index must only index short values
This commit is contained in:
parent
2c2c47fe4e
commit
0cf5a1705a
1 changed files with 12 additions and 0 deletions
|
@ -0,0 +1,12 @@
|
|||
class ShortenTopicCustomFieldsIndex < ActiveRecord::Migration
|
||||
def up
|
||||
remove_index :topic_custom_fields, :value
|
||||
add_index :topic_custom_fields, [:value, :name],
|
||||
name: 'topic_custom_fields_value_key_idx',
|
||||
where: 'value IS NOT NULL AND char_length(value) < 400'
|
||||
end
|
||||
def down
|
||||
remove_index :topic_custom_fields, :value, name: 'topic_custom_fields_value_key_idx'
|
||||
add_index :topic_custom_fields, :value
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue