Commit 012574bc authored by Alex Ives's avatar Alex Ives

Remove columns that were used for terraform state replication

- Remove indexes on the replication verification columns
- Removed constraint for verification failure text
- Removed columns that were ignored in 13.5

Relates to https://gitlab.com/gitlab-org/gitlab/issues/258262
parent eccdfbdd
---
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
......@@ -16600,13 +16600,7 @@ CREATE TABLE terraform_states (
locked_by_user_id bigint,
uuid character varying(32) NOT NULL,
name character varying(255),
verification_retry_at timestamp with time zone,
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))
versioning_enabled boolean DEFAULT false NOT NULL
);
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