mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Database backed admin notices (#26192)
This PR introduces a basic AdminNotice model to store these notices. Admin notices are categorized by their source/type (currently only notices from problem check.) They also have a priority.
This commit is contained in:
14
db/migrate/20240311015942_create_admin_notices.rb
Normal file
14
db/migrate/20240311015942_create_admin_notices.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
# frozen_string_literal: true
|
||||
class CreateAdminNotices < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
create_table :admin_notices do |t|
|
||||
t.integer :subject, null: false, index: true
|
||||
t.integer :priority, null: false
|
||||
|
||||
t.string :identifier, null: false, index: true
|
||||
t.json :details, null: false, default: {}
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddDetailsToProblemCheckTrackers < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
add_column :problem_check_trackers, :details, :json, default: {}
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddTargetToProblemCheckTrackers < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
add_column :problem_check_trackers, :target, :string, null: true
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,8 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class DisambiguateProblemCheckTrackerUniqueness < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
remove_index :problem_check_trackers, name: "index_problem_check_trackers_on_identifier"
|
||||
add_index :problem_check_trackers, %i[identifier target], unique: true
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user