Make stuff sortable

This commit is contained in:
david 2024-11-11 04:04:13 +01:00
parent 50e853098b
commit ee5dbcf33e
21 changed files with 161 additions and 28 deletions

View file

@ -0,0 +1,7 @@
class RemovePositionIndices < ActiveRecord::Migration[8.0]
def change
remove_index :success_criteria, column: [:element_id, :position]
remove_index :elements, column: [:page_id, :position]
remove_index :pages, column: [:report_id, :position]
end
end

5
db/schema.rb generated
View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[8.0].define(version: 2024_11_08_180654) do
ActiveRecord::Schema[8.0].define(version: 2024_11_11_011637) do
create_table "action_text_rich_texts", force: :cascade do |t|
t.string "name", null: false
t.text "body"
@ -115,7 +115,6 @@ ActiveRecord::Schema[8.0].define(version: 2024_11_08_180654) do
t.datetime "updated_at", null: false
t.integer "page_id", null: false
t.integer "position", null: false
t.index ["page_id", "position"], name: "index_elements_on_page_id_and_position", unique: true
t.index ["page_id"], name: "index_elements_on_page_id"
end
@ -145,7 +144,6 @@ ActiveRecord::Schema[8.0].define(version: 2024_11_08_180654) do
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.text "notes"
t.index ["report_id", "position"], name: "index_pages_on_report_id_and_position", unique: true
t.index ["report_id"], name: "index_pages_on_report_id"
end
@ -192,7 +190,6 @@ ActiveRecord::Schema[8.0].define(version: 2024_11_08_180654) do
t.integer "priority"
t.integer "position", null: false
t.index ["check_id"], name: "index_success_criteria_on_check_id"
t.index ["element_id", "position"], name: "index_success_criteria_on_element_id_and_position", unique: true
t.index ["element_id"], name: "index_success_criteria_on_element_id"
end