Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Revert "Revert "add indexes for exports""
This reverts commit ab5f6a8.
  • Loading branch information
drusepth committed Jun 18, 2021
commit 1f06f7c51009418c58211ccf84669c3d7a3b3245
6 changes: 6 additions & 0 deletions db/migrate/20210618212219_add_export_indexes.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class AddExportIndexes < ActiveRecord::Migration[6.0]
def change
add_index :attributes, [:deleted_at, :user_id, :attribute_field_id, :entity_type, :entity_id], name: "all_the_export_fields"
add_index :attributes, [:deleted_at, :user_id, :attribute_field_id, :entity_type, :entity_id, :id], name: "all_the_export_fields_with_sort"
end
end
4 changes: 3 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2021_05_01_220752) do
ActiveRecord::Schema.define(version: 2021_06_18_212219) do

create_table "active_storage_attachments", force: :cascade do |t|
t.string "name", null: false
Expand Down Expand Up @@ -169,6 +169,8 @@
t.index ["attribute_field_id", "deleted_at"], name: "index_attributes_on_attribute_field_id_and_deleted_at"
t.index ["attribute_field_id", "user_id", "entity_type", "entity_id", "deleted_at"], name: "attributes_afi_ui_et_ei_da"
t.index ["deleted_at", "attribute_field_id", "entity_type", "entity_id"], name: "deleted_at__attribute_field_id__entity_type_and_id"
t.index ["deleted_at", "user_id", "attribute_field_id", "entity_type", "entity_id", "id"], name: "all_the_export_fields_with_sort"
t.index ["deleted_at", "user_id", "attribute_field_id", "entity_type", "entity_id"], name: "all_the_export_fields"
t.index ["entity_type", "entity_id"], name: "index_attributes_on_entity_type_and_entity_id"
t.index ["user_id", "attribute_field_id"], name: "index_attributes_on_user_id_and_attribute_field_id"
t.index ["user_id", "deleted_at"], name: "index_attributes_on_user_id_and_deleted_at"
Expand Down