mirror of
https://github.com/discourse/discourse-data-explorer.git
synced 2025-02-16 16:34:47 +00:00
This commit updates the plugin to the latest guidelines, as shown in discourse-plugin-skeleton, which involves moving a lot of the code to dedicated files, use proper namespaces, use the autoloader as much as possible, etc.
32 lines
767 B
Ruby
32 lines
767 B
Ruby
# frozen_string_literal: true
|
|
|
|
class RenameDataExplorerNamespace < ActiveRecord::Migration[7.0]
|
|
def up
|
|
execute <<~SQL
|
|
UPDATE api_key_scopes
|
|
SET resource = 'discourse_data_explorer'
|
|
WHERE resource = 'data_explorer'
|
|
SQL
|
|
|
|
execute <<~SQL
|
|
UPDATE bookmarks
|
|
SET bookmarkable_type = 'DiscourseDataExplorer::QueryGroup'
|
|
WHERE bookmarkable_type = 'DataExplorer::QueryGroup'
|
|
SQL
|
|
end
|
|
|
|
def down
|
|
execute <<~SQL
|
|
UPDATE api_key_scopes
|
|
SET resource = 'data_explorer'
|
|
WHERE resource = 'discourse_data_explorer'
|
|
SQL
|
|
|
|
execute <<~SQL
|
|
UPDATE bookmarks
|
|
SET bookmarkable_type = 'DiscourseDataExplorer::QueryGroup'
|
|
WHERE bookmarkable_type = 'DataExplorer::QueryGroup'
|
|
SQL
|
|
end
|
|
end
|