Skip to content

Draft: Add ci_pipeline_id to pages_deployments

What does this MR do?

Adds the ci_pipeline_id column to the pages_deplyments table. It also adds the pipeline id when creating a Pages deployment.

DB

Up

rake db:migrate
== 20210809054753 AddCiPipelineIdToPagesDeployments: migrating ================
-- add_column(:pages_deployments, :ci_pipeline_id, :integer)
   -> 0.0026s
-- transaction_open?()
   -> 0.0000s
-- foreign_keys(:pages_deployments)
   -> 0.0061s
-- execute("ALTER TABLE pages_deployments\nADD CONSTRAINT fk_689a4298e9\nFOREIGN KEY (ci_pipeline_id)\nREFERENCES ci_pipelines (id)\nON DELETE SET NULL\nNOT VALID;\n")
   -> 0.0038s
-- execute("SET statement_timeout TO 0")
   -> 0.0005s
-- execute("ALTER TABLE pages_deployments VALIDATE CONSTRAINT fk_689a4298e9;")
   -> 0.0064s
-- execute("RESET ALL")
   -> 0.0005s
== 20210809054753 AddCiPipelineIdToPagesDeployments: migrated (0.0306s) =======

Down

❯ rake db:migrate:down VERSION=20210809054753
== 20210809054753 AddCiPipelineIdToPagesDeployments: reverting ================
-- remove_foreign_key(:pages_deployments, {:column=>:ci_pipeline_id})
   -> 0.0063s
-- remove_column(:pages_deployments, :ci_pipeline_id)
   -> 0.0007s
== 20210809054753 AddCiPipelineIdToPagesDeployments: reverted (0.0140s) =======

Screenshots or Screencasts (strongly suggested)

How to setup and validate locally (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

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

Related to #208322 (closed)

Edited by Jaime Martinez

Merge request reports