diff --git a/app/models/ci/pipeline_message.rb b/app/models/ci/pipeline_message.rb index fedbc57258dd1956415226b3b8e2af0ed21ad0c7..fa08f21271b8e9eca8def009029b74a4142da65c 100644 --- a/app/models/ci/pipeline_message.rb +++ b/app/models/ci/pipeline_message.rb @@ -3,6 +3,9 @@ module Ci class PipelineMessage < Ci::ApplicationRecord include Ci::Partitionable + include SafelyChangeColumnDefault + + columns_changing_default :partition_id MAX_CONTENT_LENGTH = 10_000 diff --git a/db/post_migrate/20240605080835_remove_partition_id_default_value_for_ci_pipeline_message.rb b/db/post_migrate/20240605080835_remove_partition_id_default_value_for_ci_pipeline_message.rb new file mode 100644 index 0000000000000000000000000000000000000000..115fbaaba0ffbe3b37745baa6c6a741cd230510d --- /dev/null +++ b/db/post_migrate/20240605080835_remove_partition_id_default_value_for_ci_pipeline_message.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class RemovePartitionIdDefaultValueForCiPipelineMessage < Gitlab::Database::Migration[2.2] + milestone '17.2' + + TABLE_NAME = :ci_pipeline_messages + COLUM_NAME = :partition_id + + def change + change_column_default(TABLE_NAME, COLUM_NAME, from: 100, to: nil) + end +end diff --git a/db/schema_migrations/20240605080835 b/db/schema_migrations/20240605080835 new file mode 100644 index 0000000000000000000000000000000000000000..38225722e946485c914c4ecda99e74e7037a5c57 --- /dev/null +++ b/db/schema_migrations/20240605080835 @@ -0,0 +1 @@ +27c7b399872c197d8238e688fe42c09f8df86964812ea7a4ae59f38bfa018400 \ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 0f2a400e0f378f1cbe43197743bcffa57226954c..9487d18f494cf121dd29cdd497929d50abbc1755 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -7601,7 +7601,7 @@ CREATE TABLE ci_pipeline_messages ( severity smallint DEFAULT 0 NOT NULL, content text NOT NULL, pipeline_id bigint NOT NULL, - partition_id bigint DEFAULT 100 NOT NULL, + partition_id bigint NOT NULL, CONSTRAINT check_58ca2981b2 CHECK ((char_length(content) <= 10000)) );