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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Rename delayed_job_statuses to job_statuses.
Pavel Balashou0294e4bc4ae3
diff --git a/db/migrate/20240229133250_rename_delayed_job_statuses.rb b/db/migrate/20240229133250_rename_delayed_job_statuses.rbnew file mode 100644index 00000000000..43ffd4dd457--- /dev/null+++ b/db/migrate/20240229133250_rename_delayed_job_statuses.rb@@ -0,0 +1,33 @@+#-- copyright+# OpenProject is an open source project management software.+# Copyright (C) 2012-2024 the OpenProject GmbH+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License version 3.+#+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:+# Copyright (C) 2006-2013 Jean-Philippe Lang+# Copyright (C) 2010-2013 the ChiliProject Team+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License+# as published by the Free Software Foundation; either version 2+# of the License, or (at your option) any later version.+#+# This program is distributed in the hope that it will be useful,+# but WITHOUT ANY WARRANTY; without even the implied warranty of+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+# GNU General Public License for more details.+#+# You should have received a copy of the GNU General Public License+# along with this program; if not, write to the Free Software+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.+#+# See COPYRIGHT and LICENSE files for more details.+#++++class RenameDelayedJobStatuses < ActiveRecord::Migration[7.1]+ def change+ rename_table :delayed_job_statuses, :job_statuses+ end+enddiff --git a/modules/job_status/app/models/job_status/status.rb b/modules/job_status/app/models/job_status/status.rbindex 6f4b3bc6a8e..928b40d91fa 100644--- a/modules/job_status/app/models/job_status/status.rb+++ b/modules/job_status/app/models/job_status/status.rb@@ -1,6 +1,34 @@+#-- copyright+# OpenProject is an open source project management software.+# Copyright (C) 2012-2024 the OpenProject GmbH+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License version 3.+#+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:+# Copyright (C) 2006-2013 Jean-Philippe Lang+# Copyright (C) 2010-2013 the ChiliProject Team+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License+# as published by the Free Software Foundation; either version 2+# of the License, or (at your option) any later version.+#+# This program is distributed in the hope that it will be useful,+# but WITHOUT ANY WARRANTY; without even the implied warranty of+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+# GNU General Public License for more details.+#+# You should have received a copy of the GNU General Public License+# along with this program; if not, write to the Free Software+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.+#+# See COPYRIGHT and LICENSE files for more details.+#+++module JobStatusclass Status < ApplicationRecord- self.table_name = 'delayed_job_statuses'+ self.table_name = 'job_statuses'belongs_to :userbelongs_to :reference, polymorphic: truediff --git a/modules/job_status/app/workers/job_status/application_job_with_status.rb b/modules/job_status/app/workers/job_status/application_job_with_status.rbindex 9aa2c8291b8..e0c6e128fce 100644--- a/modules/job_status/app/workers/job_status/application_job_with_status.rb+++ b/modules/job_status/app/workers/job_status/application_job_with_status.rb@@ -74,7 +74,7 @@ module JobStatusresource.attributes = build_status_attributes(args.merge(status:))end- # There is a possible race condition because of unique delayed_job_statuses.job_id+ # There is a possible race condition because of unique job_statuses.job_id# Can't use upsert easily, because before updating we need to know user_id# to set proper locale. Probably, it is possible to get it from# a job's payload, then it would be possible to correctly prepare attributes before using upsert.