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

20230530114845_cleanup_organizations_with_null_path.rb « post_migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6d04bf6e4ecbcbfd05c9158559977bf18d6d523d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

class CleanupOrganizationsWithNullPath < Gitlab::Database::Migration[2.1]
  restrict_gitlab_migration gitlab_schema: :gitlab_main

  module Organizations
    class Organization < Gitlab::Database::Migration[2.1]::MigrationRecord
    end
  end

  def up
    Organizations::Organization.update_all("path = lower(name)")
  end

  def down
    Organizations::Organization.update_all(path: '')
  end
end