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

actually fall back to max version if no ENV is set

ulfertse0c619f752f0
diff --git a/db/migrate/20230608151123_add_validity_period_to_journals.rb b/db/migrate/20230608151123_add_validity_period_to_journals.rb
index 0b6ce2e5f93..53eeb643450 100644
--- a/db/migrate/20230608151123_add_validity_period_to_journals.rb
+++ b/db/migrate/20230608151123_add_validity_period_to_journals.rb
@@ -17,7 +17,8 @@ class AddValidityPeriodToJournals < ActiveRecord::Migration[7.0]
end
def fix_all_journal_timestamps
- max_attempts = attempts = ENV['MAX_JOURNAL_TIMESTAMPS_ATTEMPTS'].presence.to_i || Journal.all.maximum(:version)
+ max_attempts = attempts = (ENV['MAX_JOURNAL_TIMESTAMPS_ATTEMPTS'].presence && ENV['MAX_JOURNAL_TIMESTAMPS_ATTEMPTS'].to_i) ||
+ Journal.all.maximum(:version)
loop do
break if fix_journal_timestamps == 0