Commit 74e2669d authored by Terri Chu's avatar Terri Chu Committed by Mayra Cabrera

Step 2: Remove unused columns in elastic_reindexing_tasks

parent 769ec6da
# frozen_string_literal: true
class RemoveUnusedColumnsFromElasticReindexingTasks < ActiveRecord::Migration[6.1]
include Gitlab::Database::MigrationHelpers
disable_ddl_transaction!
def up
remove_column :elastic_reindexing_tasks, :documents_count, :integer
remove_column :elastic_reindexing_tasks, :index_name_from, :text
remove_column :elastic_reindexing_tasks, :index_name_to, :text
remove_column :elastic_reindexing_tasks, :elastic_task, :text
remove_column :elastic_reindexing_tasks, :documents_count_target, :integer
end
def down
add_column :elastic_reindexing_tasks, :documents_count, :integer
add_column :elastic_reindexing_tasks, :index_name_from, :text
add_column :elastic_reindexing_tasks, :index_name_to, :text
add_column :elastic_reindexing_tasks, :elastic_task, :text
add_column :elastic_reindexing_tasks, :documents_count_target, :integer
add_text_limit :elastic_reindexing_tasks, :index_name_from, 255
add_text_limit :elastic_reindexing_tasks, :index_name_to, 255
add_text_limit :elastic_reindexing_tasks, :elastic_task, 255
end
end
c7ae79084b802723a24064cb700b6cdc9a23011d3fed45457799c1ae7aa19ce6
\ No newline at end of file
......@@ -12661,21 +12661,13 @@ CREATE TABLE elastic_reindexing_tasks (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
documents_count integer,
state smallint DEFAULT 0 NOT NULL,
in_progress boolean DEFAULT true NOT NULL,
index_name_from text,
index_name_to text,
elastic_task text,
error_message text,
documents_count_target integer,
delete_original_index_at timestamp with time zone,
max_slices_running smallint DEFAULT 60 NOT NULL,
slice_multiplier smallint DEFAULT 2 NOT NULL,
CONSTRAINT check_04151aca42 CHECK ((char_length(index_name_from) <= 255)),
CONSTRAINT check_7f64acda8e CHECK ((char_length(error_message) <= 255)),
CONSTRAINT check_85ebff7124 CHECK ((char_length(index_name_to) <= 255)),
CONSTRAINT check_942e5aae53 CHECK ((char_length(elastic_task) <= 255))
CONSTRAINT check_7f64acda8e CHECK ((char_length(error_message) <= 255))
);
CREATE SEQUENCE elastic_reindexing_tasks_id_seq
......@@ -8,7 +8,7 @@ class Elastic::ReindexingTask < ApplicationRecord
validates :max_slices_running, presence: true
validates :slice_multiplier, presence: true
ignore_columns %i[documents_count index_name_from index_name_to elastic_task documents_count_target], remove_with: '14.0', remove_after: '2021-04-22'
ignore_columns %i[documents_count index_name_from index_name_to elastic_task documents_count_target], remove_with: '14.3', remove_after: '2021-09-10'
has_many :subtasks, class_name: 'Elastic::ReindexingSubtask', foreign_key: :elastic_reindexing_task_id
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment