Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

check journal of every journable type

ulferts24b475a20056
diff --git a/db/migrate/20220818074159_fix_deleted_data_journals.rb b/db/migrate/20220818074159_fix_deleted_data_journals.rb
index af56c5fbb16..52ad1a1a166 100644
--- a/db/migrate/20220818074159_fix_deleted_data_journals.rb
+++ b/db/migrate/20220818074159_fix_deleted_data_journals.rb
@@ -40,7 +40,6 @@ class FixDeletedDataJournals < ActiveRecord::Migration[7.0]
::Journal
.connection
.select_one(insert_sql)
-
end
raise "ID is missing #{result.inspect}" unless result['id']
@@ -56,7 +55,6 @@ class FixDeletedDataJournals < ActiveRecord::Migration[7.0]
Journal
.pluck('DISTINCT(journable_type)')
.to_h do |journable_type|
- journable_type = 'WorkPackage'
journal_class = journable_type.constantize.journal_class
table_name = journal_class.table_name
@@ -74,6 +72,7 @@ class FixDeletedDataJournals < ActiveRecord::Migration[7.0]
def take_over_from_predecessor(journal, predecessor)
raise "Related journal does not have data, this shouldn't be!" if predecessor.data.nil?
+
new_data = predecessor.data.dup
new_data.save!