Skip to content

Remove columns that were used for terraform state replication

What does this MR do?

Remove columns used in the original replication of terraform states (not released)

Relates to: #258262 (closed)

Database Review

Column Ignores (In 13.5): https://gitlab.com/gitlab-org/gitlab/-/blob/v13.5.0-ee/app/models/terraform/state.rb#L10

Number of rows in the table: 2262

Up:

== 20201103013242 RemoveTerraformStateVerificationColumns: migrating ==========
-- transaction()
-- remove_column(:terraform_states, :verification_retry_at, :datetime_with_timezone)
   -> 0.0031s
-- remove_column(:terraform_states, :verified_at, :datetime_with_timezone)
   -> 0.0009s
-- remove_column(:terraform_states, :verification_retry_count, :integer, {:limit=>2})
   -> 0.0009s
-- remove_column(:terraform_states, :verification_checksum, :binary, {:using=>"verification_checksum::bytea"})
   -> 0.0008s
-- remove_column(:terraform_states, :verification_failure, :text)
   -> 0.0010s
   -> 0.0078s
== 20201103013242 RemoveTerraformStateVerificationColumns: migrated (0.0078s) =

Down:

== 20201103013242 RemoveTerraformStateVerificationColumns: reverting ==========
-- column_exists?(:terraform_states, :verification_retry_at)
   -> 0.0021s
-- add_column(:terraform_states, :verification_retry_at, :datetime_with_timezone)
   -> 0.0013s
-- column_exists?(:terraform_states, :verified_at)
   -> 0.0009s
-- add_column(:terraform_states, :verified_at, :datetime_with_timezone)
   -> 0.0010s
-- column_exists?(:terraform_states, :verification_retry_count)
   -> 0.0009s
-- add_column(:terraform_states, :verification_retry_count, :integer, {:limit=>2})
   -> 0.0009s
-- column_exists?(:terraform_states, :verification_checksum)
   -> 0.0009s
-- add_column(:terraform_states, :verification_checksum, :binary, {:using=>"verification_checksum::bytea"})
   -> 0.0012s
-- column_exists?(:terraform_states, :verification_failure)
   -> 0.0008s
-- add_column(:terraform_states, :verification_failure, :text)
   -> 0.0009s
-- transaction_open?()
   -> 0.0000s
-- current_schema()
   -> 0.0001s
-- execute("ALTER TABLE terraform_states\nADD CONSTRAINT check_21a47163ea\nCHECK ( char_length(verification_failure) <= 255 )\nNOT VALID;\n")
   -> 0.0010s
-- current_schema()
   -> 0.0002s
-- execute("SET statement_timeout TO 0")
   -> 0.0004s
-- execute("ALTER TABLE terraform_states VALIDATE CONSTRAINT check_21a47163ea;")
   -> 0.0007s
-- execute("RESET ALL")
   -> 0.0004s
== 20201103013242 RemoveTerraformStateVerificationColumns: reverted (0.0254s) =

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • 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 Alex Ives

Merge request reports

Loading