diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
commit | 9297025d0b7ddf095eb618dfaaab2ff8f2018d8b (patch) | |
tree | 865198c01d1824a9b098127baa3ab980c9cd2c06 /spec/support/helpers/models/ci/partitioning_testing/schema_helpers.rb | |
parent | 6372471f43ee03c05a7c1f8b0c6ac6b8a7431dbe (diff) |
Add latest changes from gitlab-org/gitlab@16-7-stable-eev16.7.0-rc42
Diffstat (limited to 'spec/support/helpers/models/ci/partitioning_testing/schema_helpers.rb')
-rw-r--r-- | spec/support/helpers/models/ci/partitioning_testing/schema_helpers.rb | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/spec/support/helpers/models/ci/partitioning_testing/schema_helpers.rb b/spec/support/helpers/models/ci/partitioning_testing/schema_helpers.rb index a47aaffdb43..a6c0ad143c5 100644 --- a/spec/support/helpers/models/ci/partitioning_testing/schema_helpers.rb +++ b/spec/support/helpers/models/ci/partitioning_testing/schema_helpers.rb @@ -18,7 +18,6 @@ module Ci each_partitionable_table do |table_name| create_test_partition("p_#{table_name}", connection: connection) end - ensure_builds_id_uniquness(connection: connection) end def teardown(connection: Ci::ApplicationRecord.connection) @@ -28,7 +27,7 @@ module Ci end def each_partitionable_table - ::Ci::Partitionable::Testing::PARTITIONABLE_MODELS.each do |klass| + ::Ci::Partitionable::Testing.partitionable_models.each do |klass| model = klass.safe_constantize table_name = model.table_name.delete_prefix('p_') @@ -60,16 +59,6 @@ module Ci SQL end - # This can be removed after https://gitlab.com/gitlab-org/gitlab/-/issues/421173 - # is implemented - def ensure_builds_id_uniquness(connection:) - connection.execute(<<~SQL.squish) - CREATE TRIGGER assign_p_ci_builds_id_trigger - BEFORE INSERT ON #{full_partition_name('ci_builds')} - FOR EACH ROW EXECUTE FUNCTION assign_p_ci_builds_id_value(); - SQL - end - def table_available?(table_name, connection:) connection.table_exists?(table_name) && connection.column_exists?(table_name, :partition_id) |