Commit 3752ea6c authored by dfrazao-gitlab's avatar dfrazao-gitlab

Address the PK Overflow risk for the ci_build_trace_chunks - Step 3

- Remove build_id_convert_to_bigint column
- Remove trigger_cf2f9e35f002 trigger

Related to https://gitlab.com/gitlab-org/gitlab/-/issues/338069

Changelog: added
parent 93a4df7a
# frozen_string_literal: true
class DropTemporaryColumnsAndTriggersForCiBuildTraceChunks < Gitlab::Database::Migration[1.0]
disable_ddl_transaction!
TABLE = 'ci_build_trace_chunks'
COLUMN = 'build_id'
# rubocop:disable Migration/WithLockRetriesDisallowedMethod
def up
with_lock_retries do
cleanup_conversion_of_integer_to_bigint(TABLE, COLUMN)
end
end
# rubocop:enable Migration/WithLockRetriesDisallowedMethod
def down
restore_conversion_of_integer_to_bigint(TABLE, COLUMN)
end
end
b7329d4ff7ee651b56cb86c7091e0d933c4f43a77125323fb6c283eedcb737c2
\ No newline at end of file
# frozen_string_literal: true
require 'spec_helper'
require_migration!('drop_temporary_columns_and_triggers_for_ci_build_trace_chunks')
RSpec.describe DropTemporaryColumnsAndTriggersForCiBuildTraceChunks do
let(:ci_build_trace_chunks_table) { table(:ci_build_trace_chunks) }
it 'correctly migrates up and down' do
reversible_migration do |migration|
migration.before -> {
expect(ci_build_trace_chunks_table.column_names).to include('build_id_convert_to_bigint')
}
migration.after -> {
ci_build_trace_chunks_table.reset_column_information
expect(ci_build_trace_chunks_table.column_names).not_to include('build_id_convert_to_bigint')
}
end
end
end
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