mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 04:59:22 -06:00
db74e9484b
Drag and drop to reorder custom sidebar sections
13 lines
446 B
Ruby
13 lines
446 B
Ruby
# 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
|