Commit 39070f5d authored by Patrick Bair's avatar Patrick Bair

Merge branch 'alexives/258262/remove_columns_for_tf_state_validation' into 'master'

Remove columns that were used for terraform state replication

See merge request gitlab-org/gitlab!46742
parents 81227826 012574bc
---
title: Remove columns no longer used for replicating terraform state
merge_request: 46742
author:
type: other
# frozen_string_literal: true
class RemoveTerraformStateVerificationColumns < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
transaction do
remove_column :terraform_states, :verification_retry_at, :datetime_with_timezone
remove_column :terraform_states, :verified_at, :datetime_with_timezone
remove_column :terraform_states, :verification_retry_count, :integer, limit: 2
remove_column :terraform_states, :verification_checksum, :binary, using: 'verification_checksum::bytea'
remove_column :terraform_states, :verification_failure, :text
end
end
def down
add_column(:terraform_states, :verification_retry_at, :datetime_with_timezone) unless column_exists?(:terraform_states, :verification_retry_at)
add_column(:terraform_states, :verified_at, :datetime_with_timezone) unless column_exists?(:terraform_states, :verified_at)
add_column(:terraform_states, :verification_retry_count, :integer, limit: 2) unless column_exists?(:terraform_states, :verification_retry_count)
add_column(:terraform_states, :verification_checksum, :binary, using: 'verification_checksum::bytea') unless column_exists?(:terraform_states, :verification_checksum)
add_column(:terraform_states, :verification_failure, :text) unless column_exists?(:terraform_states, :verification_failure)
add_text_limit :terraform_states, :verification_failure, 255
end
end
8a30cf20f71e0cb198caf6f77a19e4da55b83eb38bdb5888cd2674373d94cede
\ No newline at end of file
...@@ -16623,13 +16623,7 @@ CREATE TABLE terraform_states ( ...@@ -16623,13 +16623,7 @@ CREATE TABLE terraform_states (
locked_by_user_id bigint, locked_by_user_id bigint,
uuid character varying(32) NOT NULL, uuid character varying(32) NOT NULL,
name character varying(255), name character varying(255),
verification_retry_at timestamp with time zone, versioning_enabled boolean DEFAULT false NOT NULL
verified_at timestamp with time zone,
verification_retry_count smallint,
verification_checksum bytea,
verification_failure text,
versioning_enabled boolean DEFAULT false NOT NULL,
CONSTRAINT check_21a47163ea CHECK ((char_length(verification_failure) <= 255))
); );
CREATE SEQUENCE terraform_states_id_seq CREATE SEQUENCE terraform_states_id_seq
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment