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 'lib/gitlab/database/migration_helpers/restrict_gitlab_schema.rb')
-rw-r--r--lib/gitlab/database/migration_helpers/restrict_gitlab_schema.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/gitlab/database/migration_helpers/restrict_gitlab_schema.rb b/lib/gitlab/database/migration_helpers/restrict_gitlab_schema.rb
index b4e31565c60..5a25128f3a9 100644
--- a/lib/gitlab/database/migration_helpers/restrict_gitlab_schema.rb
+++ b/lib/gitlab/database/migration_helpers/restrict_gitlab_schema.rb
@@ -6,8 +6,6 @@ module Gitlab
module RestrictGitlabSchema
extend ActiveSupport::Concern
- MigrationSkippedError = Class.new(StandardError)
-
included do
class_attribute :allowed_gitlab_schemas
end
@@ -25,11 +23,8 @@ module Gitlab
def migrate(direction)
if unmatched_schemas.any?
- # TODO: Today skipping migration would raise an exception.
- # Ideally, skipped migration should be ignored (not loaded), or softly ignored.
- # Read more in: https://gitlab.com/gitlab-org/gitlab/-/issues/355014
- raise MigrationSkippedError, "Current migration is skipped since it modifies "\
- "'#{self.class.allowed_gitlab_schemas}' which is outside of '#{allowed_schemas_for_connection}'"
+ migration_skipped
+ return
end
Gitlab::Database::QueryAnalyzer.instance.within([validator_class]) do
@@ -41,6 +36,11 @@ module Gitlab
private
+ def migration_skipped
+ say "Current migration is skipped since it modifies "\
+ "'#{self.class.allowed_gitlab_schemas}' which is outside of '#{allowed_schemas_for_connection}'"
+ end
+
def validator_class
Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas
end