mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
FEATURE: ability to reorder links in custom sidebar sections (#20626)
Drag and drop to reorder custom sidebar sections
This commit is contained in:

committed by
GitHub

parent
53cadac4b8
commit
db74e9484b
@ -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
|
Reference in New Issue
Block a user