diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-18 15:08:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-18 15:08:09 +0300 |
commit | 823d2f9a2c8796e5061c59595f96a1132641b26a (patch) | |
tree | 219b13820bd398acc48f3cc719c7a7bfdf77aa26 /db | |
parent | 627bd5db4e091d0be312c880cbb9139b7c86818b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/post_migrate/20240117132031_routing_table_prepare_constraint_for_pipeline_variables.rb | 32 | ||||
-rw-r--r-- | db/schema_migrations/20240117132031 | 1 | ||||
-rw-r--r-- | db/structure.sql | 6 |
3 files changed, 35 insertions, 4 deletions
diff --git a/db/post_migrate/20240117132031_routing_table_prepare_constraint_for_pipeline_variables.rb b/db/post_migrate/20240117132031_routing_table_prepare_constraint_for_pipeline_variables.rb new file mode 100644 index 00000000000..00591d7adbb --- /dev/null +++ b/db/post_migrate/20240117132031_routing_table_prepare_constraint_for_pipeline_variables.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +class RoutingTablePrepareConstraintForPipelineVariables < Gitlab::Database::Migration[2.2] + include Gitlab::Database::PartitioningMigrationHelpers::TableManagementHelpers + + milestone '16.9' + + 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 + ) + 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 diff --git a/db/schema_migrations/20240117132031 b/db/schema_migrations/20240117132031 new file mode 100644 index 00000000000..a0ef1ac2ddc --- /dev/null +++ b/db/schema_migrations/20240117132031 @@ -0,0 +1 @@ +415eb5664fd908c7665b8f141e5f2bc8303f70a06b4a9ee3b88789d858f3cf19
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 0abd72fb88c..90bfc512a51 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -14713,7 +14713,8 @@ CREATE TABLE ci_pipeline_variables ( partition_id bigint NOT NULL, raw boolean DEFAULT false NOT NULL, id bigint NOT NULL, - pipeline_id bigint NOT NULL + pipeline_id bigint NOT NULL, + CONSTRAINT partitioning_constraint CHECK ((partition_id = ANY (ARRAY[(100)::bigint, (101)::bigint]))) ); CREATE SEQUENCE ci_pipeline_variables_id_seq @@ -30141,9 +30142,6 @@ ALTER TABLE ONLY pages_domain_acme_orders ALTER TABLE ONLY pages_domains ADD CONSTRAINT pages_domains_pkey PRIMARY KEY (id); -ALTER TABLE ci_pipeline_variables - ADD CONSTRAINT partitioning_constraint CHECK ((partition_id = ANY (ARRAY[(100)::bigint, (101)::bigint]))) NOT VALID; - ALTER TABLE ONLY path_locks ADD CONSTRAINT path_locks_pkey PRIMARY KEY (id); |