Commit 45b010cb authored by Krasimir Angelov's avatar Krasimir Angelov

Cleanup bigint conversion for ci_stages

- remove column id_convert_to_bigint
- remove trigger_490d204c00b3 trigger and function

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

Changelog: other
parent 83c1861b
# frozen_string_literal: true
class CleanupBigintConversionForCiStages < Gitlab::Database::Migration[1.0]
disable_ddl_transaction!
TABLE = :ci_stages
# rubocop:disable Migration/WithLockRetriesDisallowedMethod
def up
with_lock_retries do
cleanup_conversion_of_integer_to_bigint(TABLE, :id)
end
end
# rubocop:enable Migration/WithLockRetriesDisallowedMethod
def down
restore_conversion_of_integer_to_bigint(TABLE, :id)
end
end
53d1dee0bbe106eeaad3eda6e8012475cf4b59d30f78020c8d2ecf3499ff7e0f
\ No newline at end of file
...@@ -71,15 +71,6 @@ BEGIN ...@@ -71,15 +71,6 @@ BEGIN
END; END;
$$; $$;
CREATE FUNCTION trigger_490d204c00b3() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
NEW."id_convert_to_bigint" := NEW."id";
RETURN NEW;
END;
$$;
CREATE FUNCTION trigger_51ab7cef8934() RETURNS trigger CREATE FUNCTION trigger_51ab7cef8934() RETURNS trigger
LANGUAGE plpgsql LANGUAGE plpgsql
AS $$ AS $$
...@@ -12060,7 +12051,6 @@ CREATE SEQUENCE ci_sources_projects_id_seq ...@@ -12060,7 +12051,6 @@ CREATE SEQUENCE ci_sources_projects_id_seq
ALTER SEQUENCE ci_sources_projects_id_seq OWNED BY ci_sources_projects.id; ALTER SEQUENCE ci_sources_projects_id_seq OWNED BY ci_sources_projects.id;
CREATE TABLE ci_stages ( CREATE TABLE ci_stages (
id_convert_to_bigint integer DEFAULT 0 NOT NULL,
project_id integer, project_id integer,
pipeline_id integer, pipeline_id integer,
created_at timestamp without time zone, created_at timestamp without time zone,
...@@ -27314,8 +27304,6 @@ CREATE TRIGGER trigger_21e7a2602957 BEFORE INSERT OR UPDATE ON ci_build_needs FO ...@@ -27314,8 +27304,6 @@ 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 FUNCTION trigger_3f6129be01d2(); CREATE TRIGGER trigger_3f6129be01d2 BEFORE INSERT OR UPDATE ON ci_builds FOR EACH ROW EXECUTE FUNCTION trigger_3f6129be01d2();
CREATE TRIGGER trigger_490d204c00b3 BEFORE INSERT OR UPDATE ON ci_stages FOR EACH ROW EXECUTE FUNCTION trigger_490d204c00b3();
CREATE TRIGGER trigger_51ab7cef8934 BEFORE INSERT OR UPDATE ON ci_builds_runner_session FOR EACH ROW EXECUTE FUNCTION trigger_51ab7cef8934(); CREATE TRIGGER trigger_51ab7cef8934 BEFORE INSERT OR UPDATE ON ci_builds_runner_session FOR EACH ROW EXECUTE FUNCTION trigger_51ab7cef8934();
CREATE TRIGGER trigger_542d6c2ad72e BEFORE INSERT OR UPDATE ON ci_builds_metadata FOR EACH ROW EXECUTE FUNCTION trigger_542d6c2ad72e(); CREATE TRIGGER trigger_542d6c2ad72e BEFORE INSERT OR UPDATE ON ci_builds_metadata FOR EACH ROW EXECUTE FUNCTION trigger_542d6c2ad72e();
...@@ -984,6 +984,7 @@ module Gitlab ...@@ -984,6 +984,7 @@ module Gitlab
temporary_columns.each { |column| remove_column(table, column) } temporary_columns.each { |column| remove_column(table, column) }
end end
alias_method :cleanup_conversion_of_integer_to_bigint, :revert_initialize_conversion_of_integer_to_bigint
# Reverts `cleanup_conversion_of_integer_to_bigint` # Reverts `cleanup_conversion_of_integer_to_bigint`
# #
......
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