Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20240111134328_routing_table_prepare_async_constraint_for_pipeline_variables.rb')
-rw-r--r--db/migrate/20240111134328_routing_table_prepare_async_constraint_for_pipeline_variables.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/db/migrate/20240111134328_routing_table_prepare_async_constraint_for_pipeline_variables.rb b/db/migrate/20240111134328_routing_table_prepare_async_constraint_for_pipeline_variables.rb
new file mode 100644
index 00000000000..4cf3d9c1721
--- /dev/null
+++ b/db/migrate/20240111134328_routing_table_prepare_async_constraint_for_pipeline_variables.rb
@@ -0,0 +1,33 @@
+# frozen_string_literal: true
+
+class RoutingTablePrepareAsyncConstraintForPipelineVariables < Gitlab::Database::Migration[2.2]
+ include Gitlab::Database::PartitioningMigrationHelpers::TableManagementHelpers
+
+ milestone '16.8'
+
+ disable_ddl_transaction!
+
+ TABLE_NAME = :ci_pipeline_variables
+ PARENT_TABLE_NAME = :p_ci_pipeline_variables
+ FIRST_PARTITION = [100, 101]
+ PARTITION_COLUMN = :partition_id
+
+ def up
+ prepare_constraint_for_list_partitioning(
+ table_name: TABLE_NAME,
+ partitioning_column: PARTITION_COLUMN,
+ parent_table_name: PARENT_TABLE_NAME,
+ initial_partitioning_value: FIRST_PARTITION,
+ async: true
+ )
+ end
+
+ def down
+ revert_preparing_constraint_for_list_partitioning(
+ table_name: TABLE_NAME,
+ partitioning_column: PARTITION_COLUMN,
+ parent_table_name: PARENT_TABLE_NAME,
+ initial_partitioning_value: FIRST_PARTITION
+ )
+ end
+end