Fix index.

This commit is contained in:
邱博亞 2024-08-17 11:35:38 +08:00
parent 68cba0a1f7
commit 334a1c7e69
2 changed files with 3 additions and 3 deletions

View File

@ -22,8 +22,8 @@ class ColumnEntry
belongs_to :table_column, index: true
I18n.available_locales.each do |locale|
index({text: 1}, { collation: {locale: locale.to_s}, unique: false, background: true })
index({content: 1}, { collation: {locale: locale.to_s}, unique: false, background: true })
index({"text.#{locale}" => 1}, { unique: false, background: true })
index({"content.#{locale}" => 1}, { unique: false, background: true })
end

View File

@ -14,7 +14,7 @@ class TableEntry
accepts_nested_attributes_for :column_entries, :allow_destroy => true
I18n.available_locales.each do |locale|
index({have_data: 1}, { collation: {locale: locale.to_s}, unique: false, background: true })
index({"have_data.#{locale}" => 1}, { unique: false, background: true })
end
before_save do