Skip to content

Add a command so that id column can be displayed in the results

David Wainaina requested to merge docs-dwainaina-master-patch-48713 into master

What does this MR do and why?

The output of the query hides the job_class_name since it takes the job_class_name as alias of ID column.

Before change

gitlabhq_production=# SELECT
gitlabhq_production-#  id job_class_name,
gitlabhq_production-#  table_name,
gitlabhq_production-#  column_name,
gitlabhq_production-#  job_arguments
gitlabhq_production-# FROM batched_background_migrations
gitlabhq_production-# WHERE status <> 3;

 job_class_name |     table_name     | column_name |                                   job_arguments
----------------+--------------------+-------------+------------------------------------------------------------------------------------
             1 | taggings           | id          | [["id", "taggable_id"], ["id_convert_to_bigint", "taggable_id_convert_to_bigint"]]
             2 | deployments        | id          | [["deployable_id"], ["deployable_id_convert_to_bigint"]]
             3 | ci_stages          | id          | [["id"], ["id_convert_to_bigint"]]
             4 | ci_builds_metadata | id          | [["id"], ["id_convert_to_bigint"]]
(4 rows)

After change

gitlabhq_production=# SELECT
gitlabhq_production-#  id,  job_class_name,
gitlabhq_production-#  table_name,
gitlabhq_production-#  column_name,
gitlabhq_production-#  job_arguments
gitlabhq_production-# FROM batched_background_migrations
gitlabhq_production-# WHERE status <> 3;
 id |            job_class_name             |     table_name     | column_name |                                   job_arguments              
----+---------------------------------------+--------------------+-------------+------------------------------------------------------------------------------------
 1 | CopyColumnUsingBackgroundMigrationJob | taggings           | id          | [["id", "taggable_id"], ["id_convert_to_bigint", "taggable_id_convert_to_bigint"]] 
 2 | CopyColumnUsingBackgroundMigrationJob | deployments        | id          | [["deployable_id"], ["deployable_id_convert_to_bigint"]]             
 3 | CopyColumnUsingBackgroundMigrationJob | ci_stages          | id          | [["id"], ["id_convert_to_bigint"]]              
 4 | CopyColumnUsingBackgroundMigrationJob | ci_builds_metadata | id          | [["id"], ["id_convert_to_bigint"]]             
(4 rows)

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports