From f3e93bbc26d34e89bc0b9d82c00be80a6e6c155d Mon Sep 17 00:00:00 2001 From: Eric Guo Date: Fri, 8 Mar 2024 00:32:16 +0800 Subject: [PATCH] Revert "[#48717] Add forgotten GoodJob migrations." This reverts commit 6ca2feb0147a528e8d172cc70e4cd97f76aa8eac. --- .../20240306154734_create_good_job_labels.rb | 43 ---------------- ...0306154735_create_good_job_labels_index.rb | 50 ------------------- ...6154736_remove_good_job_active_id_index.rb | 49 ------------------ ...ndex_good_job_jobs_for_candidate_lookup.rb | 47 ----------------- 4 files changed, 189 deletions(-) delete mode 100644 db/migrate/20240306154734_create_good_job_labels.rb delete mode 100644 db/migrate/20240306154735_create_good_job_labels_index.rb delete mode 100644 db/migrate/20240306154736_remove_good_job_active_id_index.rb delete mode 100644 db/migrate/20240306154737_create_index_good_job_jobs_for_candidate_lookup.rb diff --git a/db/migrate/20240306154734_create_good_job_labels.rb b/db/migrate/20240306154734_create_good_job_labels.rb deleted file mode 100644 index 48e9770eedb4..000000000000 --- a/db/migrate/20240306154734_create_good_job_labels.rb +++ /dev/null @@ -1,43 +0,0 @@ -# frozen_string_literal: true - -#-- 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 CreateGoodJobLabels < ActiveRecord::Migration[7.1] - def change - reversible do |dir| - dir.up do - # Ensure this incremental update migration is idempotent - # with monolithic install migration. - return if connection.column_exists?(:good_jobs, :labels) - end - end - - add_column :good_jobs, :labels, :text, array: true - end -end diff --git a/db/migrate/20240306154735_create_good_job_labels_index.rb b/db/migrate/20240306154735_create_good_job_labels_index.rb deleted file mode 100644 index cbfc68793565..000000000000 --- a/db/migrate/20240306154735_create_good_job_labels_index.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -#-- 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 CreateGoodJobLabelsIndex < ActiveRecord::Migration[7.1] - disable_ddl_transaction! - - def change - reversible do |dir| - dir.up do - unless connection.index_name_exists?(:good_jobs, :index_good_jobs_on_labels) - add_index :good_jobs, :labels, using: :gin, where: "(labels IS NOT NULL)", - name: :index_good_jobs_on_labels, algorithm: :concurrently - end - end - - dir.down do - if connection.index_name_exists?(:good_jobs, :index_good_jobs_on_labels) - remove_index :good_jobs, name: :index_good_jobs_on_labels - end - end - end - end -end diff --git a/db/migrate/20240306154736_remove_good_job_active_id_index.rb b/db/migrate/20240306154736_remove_good_job_active_id_index.rb deleted file mode 100644 index f54d20488a16..000000000000 --- a/db/migrate/20240306154736_remove_good_job_active_id_index.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -#-- 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 RemoveGoodJobActiveIdIndex < ActiveRecord::Migration[7.1] - disable_ddl_transaction! - - def change - reversible do |dir| - dir.up do - if connection.index_name_exists?(:good_jobs, :index_good_jobs_on_active_job_id) - remove_index :good_jobs, name: :index_good_jobs_on_active_job_id - end - end - - dir.down do - unless connection.index_name_exists?(:good_jobs, :index_good_jobs_on_active_job_id) - add_index :good_jobs, :active_job_id, name: :index_good_jobs_on_active_job_id - end - end - end - end -end diff --git a/db/migrate/20240306154737_create_index_good_job_jobs_for_candidate_lookup.rb b/db/migrate/20240306154737_create_index_good_job_jobs_for_candidate_lookup.rb deleted file mode 100644 index 318fc758d4e7..000000000000 --- a/db/migrate/20240306154737_create_index_good_job_jobs_for_candidate_lookup.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -#-- 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 CreateIndexGoodJobJobsForCandidateLookup < ActiveRecord::Migration[7.1] - disable_ddl_transaction! - - def change - reversible do |dir| - dir.up do - # Ensure this incremental update migration is idempotent - # with monolithic install migration. - return if connection.index_name_exists?(:good_jobs, :index_good_job_jobs_for_candidate_lookup) - end - end - - add_index :good_jobs, [:priority, :created_at], order: { priority: "ASC NULLS LAST", created_at: :asc }, - where: "finished_at IS NULL", name: :index_good_job_jobs_for_candidate_lookup, - algorithm: :concurrently - end -end