Commit 297a6e4b authored by Patrick Bair's avatar Patrick Bair

Merge branch '338071-push-event-payloads-cleanup-step-3-2-remove-columns' into 'master'

Drop old int4 PK column for push_event_payloads

See merge request gitlab-org/gitlab!70920
parents 199f6060 6e19f4ee
# frozen_string_literal: true
class DropInt4ColumnForPushEventPayloads < Gitlab::Database::Migration[1.0]
enable_lock_retries!
def change
remove_column :push_event_payloads, :event_id_convert_to_bigint, :integer, null: false, default: 0
end
end
4f3a1dbf39f1955122f94616952bfe04836c43e97268035b2daec3bc16e55e66
\ No newline at end of file
...@@ -18446,7 +18446,6 @@ ALTER SEQUENCE protected_tags_id_seq OWNED BY protected_tags.id; ...@@ -18446,7 +18446,6 @@ ALTER SEQUENCE protected_tags_id_seq OWNED BY protected_tags.id;
CREATE TABLE push_event_payloads ( CREATE TABLE push_event_payloads (
commit_count bigint NOT NULL, commit_count bigint NOT NULL,
event_id_convert_to_bigint integer DEFAULT 0 NOT NULL,
action smallint NOT NULL, action smallint NOT NULL,
ref_type smallint NOT NULL, ref_type smallint NOT NULL,
commit_from bytea, commit_from bytea,
# frozen_string_literal: true
require 'spec_helper'
require_migration!('drop_int4_column_for_push_event_payloads')
RSpec.describe DropInt4ColumnForPushEventPayloads do
let(:push_event_payloads) { table(:push_event_payloads) }
it 'correctly migrates up and down' do
reversible_migration do |migration|
migration.before -> {
expect(push_event_payloads.column_names).to include('event_id_convert_to_bigint')
}
migration.after -> {
push_event_payloads.reset_column_information
expect(push_event_payloads.column_names).not_to include('event_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