Commit a68c3b15 authored by Krasimir Angelov's avatar Krasimir Angelov Committed by Andreas Brandl

Initialize conversion of ci_builds_runner_session.build_id to bigint

See https://gitlab.com/gitlab-org/gitlab/-/issues/328444.
parent 59d74b5c
...@@ -5,6 +5,9 @@ module Ci ...@@ -5,6 +5,9 @@ module Ci
# Data will be removed after transitioning from running to any state. # Data will be removed after transitioning from running to any state.
class BuildRunnerSession < ApplicationRecord class BuildRunnerSession < ApplicationRecord
extend Gitlab::Ci::Model extend Gitlab::Ci::Model
include IgnorableColumns
ignore_columns :build_id_convert_to_bigint, remove_with: '14.1', remove_after: '2021-07-22'
TERMINAL_SUBPROTOCOL = 'terminal.gitlab.com' TERMINAL_SUBPROTOCOL = 'terminal.gitlab.com'
DEFAULT_SERVICE_NAME = 'build' DEFAULT_SERVICE_NAME = 'build'
......
---
title: Initialize conversion of ci_builds_runner_session.build_id to bigint
merge_request: 60366
author:
type: other
# frozen_string_literal: true
class InitializeConversionOfCiBuildsRunnerSessionToBigint < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
TABLE = :ci_builds_runner_session
COLUMNS = %i(build_id)
def up
initialize_conversion_of_integer_to_bigint(TABLE, COLUMNS)
end
def down
revert_initialize_conversion_of_integer_to_bigint(TABLE, COLUMNS)
end
end
# frozen_string_literal: true
class BackfillCiBuildsRunnerSessionForBigintConversion < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
TABLE = :ci_builds_runner_session
COLUMNS = %i(build_id)
def up
return unless should_run?
backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS)
end
def down
return unless should_run?
revert_backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS)
end
private
def should_run?
Gitlab.dev_or_test_env? || Gitlab.com?
end
end
a2fcf3576de4ee5afdab8d07ffc6c2c8f96d6cc85c332f6ab69f2936bf9e58ae
\ No newline at end of file
2e30910d106dd6805f42ffc226d9008b826fa88eaec7091960e11db850b714c4
\ No newline at end of file
...@@ -125,6 +125,15 @@ BEGIN ...@@ -125,6 +125,15 @@ BEGIN
END; END;
$$; $$;
CREATE FUNCTION trigger_51ab7cef8934() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
NEW."build_id_convert_to_bigint" := NEW."build_id";
RETURN NEW;
END;
$$;
CREATE FUNCTION trigger_69523443cc10() RETURNS trigger CREATE FUNCTION trigger_69523443cc10() RETURNS trigger
LANGUAGE plpgsql LANGUAGE plpgsql
AS $$ AS $$
...@@ -10486,7 +10495,8 @@ CREATE TABLE ci_builds_runner_session ( ...@@ -10486,7 +10495,8 @@ CREATE TABLE ci_builds_runner_session (
build_id integer NOT NULL, build_id integer NOT NULL,
url character varying NOT NULL, url character varying NOT NULL,
certificate character varying, certificate character varying,
"authorization" character varying "authorization" character varying,
build_id_convert_to_bigint bigint DEFAULT 0 NOT NULL
); );
CREATE SEQUENCE ci_builds_runner_session_id_seq CREATE SEQUENCE ci_builds_runner_session_id_seq
...@@ -24768,6 +24778,8 @@ CREATE TRIGGER trigger_21e7a2602957 BEFORE INSERT OR UPDATE ON ci_build_needs FO ...@@ -24768,6 +24778,8 @@ CREATE TRIGGER trigger_21e7a2602957 BEFORE INSERT OR UPDATE ON ci_build_needs FO
CREATE TRIGGER trigger_3f6129be01d2 BEFORE INSERT OR UPDATE ON ci_builds FOR EACH ROW EXECUTE PROCEDURE trigger_3f6129be01d2(); CREATE TRIGGER trigger_3f6129be01d2 BEFORE INSERT OR UPDATE ON ci_builds FOR EACH ROW EXECUTE PROCEDURE trigger_3f6129be01d2();
CREATE TRIGGER trigger_51ab7cef8934 BEFORE INSERT OR UPDATE ON ci_builds_runner_session FOR EACH ROW EXECUTE PROCEDURE trigger_51ab7cef8934();
CREATE TRIGGER trigger_69523443cc10 BEFORE INSERT OR UPDATE ON events FOR EACH ROW EXECUTE PROCEDURE trigger_69523443cc10(); CREATE TRIGGER trigger_69523443cc10 BEFORE INSERT OR UPDATE ON events FOR EACH ROW EXECUTE PROCEDURE trigger_69523443cc10();
CREATE TRIGGER trigger_8485e97c00e3 BEFORE INSERT OR UPDATE ON ci_sources_pipelines FOR EACH ROW EXECUTE PROCEDURE trigger_8485e97c00e3(); CREATE TRIGGER trigger_8485e97c00e3 BEFORE INSERT OR UPDATE ON ci_sources_pipelines FOR EACH ROW EXECUTE PROCEDURE trigger_8485e97c00e3();
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