Step 2: Remove unused columns in elastic_reindexing_tasks
What does this MR do?
Related to #322394 (closed)
- remove columns from
elastic_reindexing_tasks
table that are already ignored - update the remove_with and remove_after data in the
ignore_columns
statement to the next release
Full plan to remove unused columns in elastic_reindexing_tasks
table according to the guidelines
- add ignore_columns - !54666 (merged) (completed in %13.10)
- remove columns - #322394 (closed) (this MR)
- remove ignore_columns from code - #322396 (closed) (scheduled for %14.3)
Database
up
➜ bundle exec rails db:migrate
== 20210727175201 RemoveUnusedColumnsFromElasticReindexingTasks: migrating ====
-- remove_column(:elastic_reindexing_tasks, :documents_count, :integer)
-> 0.0028s
-- remove_column(:elastic_reindexing_tasks, :index_name_from, :text)
-> 0.0025s
-- remove_column(:elastic_reindexing_tasks, :index_name_to, :text)
-> 0.0014s
-- remove_column(:elastic_reindexing_tasks, :elastic_task, :text)
-> 0.0013s
-- remove_column(:elastic_reindexing_tasks, :documents_count_target, :integer)
-> 0.0011s
== 20210727175201 RemoveUnusedColumnsFromElasticReindexingTasks: migrated (0.0093s)
down
➜ bundle exec rails db:rollback
== 20210727175201 RemoveUnusedColumnsFromElasticReindexingTasks: reverting ====
-- add_column(:elastic_reindexing_tasks, :documents_count, :integer)
-> 0.0020s
-- add_column(:elastic_reindexing_tasks, :index_name_from, :text)
-> 0.0011s
-- add_column(:elastic_reindexing_tasks, :index_name_to, :text)
-> 0.0010s
-- add_column(:elastic_reindexing_tasks, :elastic_task, :text)
-> 0.0010s
-- add_column(:elastic_reindexing_tasks, :documents_count_target, :integer)
-> 0.0009s
-- transaction_open?()
-> 0.0000s
-- current_schema()
-> 0.0002s
-- execute("ALTER TABLE elastic_reindexing_tasks\nADD CONSTRAINT check_04151aca42\nCHECK ( char_length(index_name_from) <= 255 )\nNOT VALID;\n")
-> 0.0011s
-- current_schema()
-> 0.0001s
-- execute("SET statement_timeout TO 0")
-> 0.0005s
-- execute("ALTER TABLE elastic_reindexing_tasks VALIDATE CONSTRAINT check_04151aca42;")
-> 0.0009s
-- execute("RESET ALL")
-> 0.0005s
-- transaction_open?()
-> 0.0000s
-- current_schema()
-> 0.0001s
-- execute("ALTER TABLE elastic_reindexing_tasks\nADD CONSTRAINT check_85ebff7124\nCHECK ( char_length(index_name_to) <= 255 )\nNOT VALID;\n")
-> 0.0008s
-- current_schema()
-> 0.0002s
-- execute("ALTER TABLE elastic_reindexing_tasks VALIDATE CONSTRAINT check_85ebff7124;")
-> 0.0008s
-- transaction_open?()
-> 0.0000s
-- current_schema()
-> 0.0002s
-- execute("ALTER TABLE elastic_reindexing_tasks\nADD CONSTRAINT check_942e5aae53\nCHECK ( char_length(elastic_task) <= 255 )\nNOT VALID;\n")
-> 0.0007s
-- current_schema()
-> 0.0002s
-- execute("ALTER TABLE elastic_reindexing_tasks VALIDATE CONSTRAINT check_942e5aae53;")
-> 0.0009s
== 20210727175201 RemoveUnusedColumnsFromElasticReindexingTasks: reverted (0.0347s)
Screenshots or Screencasts (strongly suggested)
Does this MR meet the acceptance criteria?
Conformity
-
I have included changelog trailers, or none are needed. (Does this MR need a changelog?) -
I have added/updated documentation, or it's not needed. (Is documentation required?) -
I have properly separated EE content from FOSS, or this MR is FOSS only. (Where should EE code go?) -
I have added information for database reviewers in the MR description, or it's not needed. (Does this MR have database related changes?) -
I have self-reviewed this MR per code review guidelines. -
This MR does not harm performance, or I have asked a reviewer to help assess the performance impact. (Merge request performance guidelines) -
I have followed the style guides. -
This change is backwards compatible across updates, or this does not apply.
Availability and Testing
-
I have added/updated tests following the Testing Guide, or it's not needed. (Consider all test levels. See the Test Planning Process.) -
I have tested this MR in all supported browsers, or it's not needed. -
I have informed the Infrastructure department of a default or new setting change per definition of done, or it's not needed.
Security
Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Edited by Terri Chu