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 'spec/support/helpers/models')
-rw-r--r--spec/support/helpers/models/ci/partitioning_testing/cascade_check.rb2
-rw-r--r--spec/support/helpers/models/ci/partitioning_testing/schema_helpers.rb13
2 files changed, 2 insertions, 13 deletions
diff --git a/spec/support/helpers/models/ci/partitioning_testing/cascade_check.rb b/spec/support/helpers/models/ci/partitioning_testing/cascade_check.rb
index 81c2d2cb225..7bcb8e5fcac 100644
--- a/spec/support/helpers/models/ci/partitioning_testing/cascade_check.rb
+++ b/spec/support/helpers/models/ci/partitioning_testing/cascade_check.rb
@@ -25,7 +25,7 @@ module PartitioningTesting
end
end
-Ci::Partitionable::Testing::PARTITIONABLE_MODELS.each do |klass|
+Ci::Partitionable::Testing.partitionable_models.each do |klass|
next if klass == 'Ci::Pipeline'
model = klass.safe_constantize
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)