Commit 751d343e authored by Krasimir Angelov's avatar Krasimir Angelov

Drop old int4 PK columns for ci_job_artifacts

- Drop column `id_convert_to_bigint`
- Drop column `job_id_convert_to_bigint`

Columns were ignored in 14.3 with
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68770.

https://gitlab.com/gitlab-org/gitlab/-/issues/338068.

Changelog: other
parent a1b4d1fe
# 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
......@@ -11535,9 +11535,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