Commit b35689f3 authored by Patrick Bair's avatar Patrick Bair

Merge branch '338068-step-3-2-remove-columns' into 'master'

Drop old int4 PK columns for ci_job_artifacts

See merge request gitlab-org/gitlab!70884
parents f6d0fd0e 751d343e
# frozen_string_literal: true
class DropInt4ColumnsForCiJobArtifacts < Gitlab::Database::Migration[1.0]
enable_lock_retries!
def change
remove_column :ci_job_artifacts, :id_convert_to_bigint, :integer, null: false, default: 0
remove_column :ci_job_artifacts, :job_id_convert_to_bigint, :integer, null: false, default: 0
end
end
1d18e061cb5bcdaa7d3fcea93e58d65a6f2c8b557fe53ba461b6cfa570f565be
\ No newline at end of file
......@@ -11506,9 +11506,7 @@ CREATE SEQUENCE ci_instance_variables_id_seq
ALTER SEQUENCE ci_instance_variables_id_seq OWNED BY ci_instance_variables.id;
CREATE TABLE ci_job_artifacts (
id_convert_to_bigint integer DEFAULT 0 NOT NULL,
project_id integer NOT NULL,
job_id_convert_to_bigint integer DEFAULT 0 NOT NULL,
file_type integer NOT NULL,
size bigint,
created_at timestamp with time zone NOT NULL,
# frozen_string_literal: true
require 'spec_helper'
require_migration!('drop_int4_columns_for_ci_job_artifacts')
RSpec.describe DropInt4ColumnsForCiJobArtifacts do
let(:ci_job_artifacts) { table(:ci_job_artifacts) }
it 'correctly migrates up and down' do
reversible_migration do |migration|
migration.before -> {
expect(ci_job_artifacts.column_names).to include('id_convert_to_bigint')
expect(ci_job_artifacts.column_names).to include('job_id_convert_to_bigint')
}
migration.after -> {
ci_job_artifacts.reset_column_information
expect(ci_job_artifacts.column_names).not_to include('id_convert_to_bigint')
expect(ci_job_artifacts.column_names).not_to include('job_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