FEATURE: ability to reorder links in custom sidebar sections (#20626)

Drag and drop to reorder custom sidebar sections
This commit is contained in:
Krzysztof Kotlarek
2023-03-21 12:23:28 +11:00
committed by GitHub
parent 53cadac4b8
commit db74e9484b
17 changed files with 343 additions and 46 deletions

View File

@ -0,0 +1,12 @@
# frozen_string_literal: true
class AddPositionToSidebarSectionLinks < ActiveRecord::Migration[7.0]
def change
add_column :sidebar_section_links, :position, :integer, default: 0, null: false
execute "UPDATE sidebar_section_links SET position = id"
add_index :sidebar_section_links,
%i[user_id sidebar_section_id position],
unique: true,
name: "links_user_id_section_id_position"
end
end