Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
74e2669d
Commit
74e2669d
authored
Jul 29, 2021
by
Terri Chu
Committed by
Mayra Cabrera
Jul 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Step 2: Remove unused columns in elastic_reindexing_tasks
parent
769ec6da
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
10 deletions
+30
-10
db/post_migrate/20210727175201_remove_unused_columns_from_elastic_reindexing_tasks.rb
...01_remove_unused_columns_from_elastic_reindexing_tasks.rb
+27
-0
db/schema_migrations/20210727175201
db/schema_migrations/20210727175201
+1
-0
db/structure.sql
db/structure.sql
+1
-9
ee/app/models/elastic/reindexing_task.rb
ee/app/models/elastic/reindexing_task.rb
+1
-1
No files found.
db/post_migrate/20210727175201_remove_unused_columns_from_elastic_reindexing_tasks.rb
0 → 100644
View file @
74e2669d
# 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
db/schema_migrations/20210727175201
0 → 100644
View file @
74e2669d
c7ae79084b802723a24064cb700b6cdc9a23011d3fed45457799c1ae7aa19ce6
\ No newline at end of file
db/structure.sql
View file @
74e2669d
...
...
@@ -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
ee/app/models/elastic/reindexing_task.rb
View file @
74e2669d
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment