Skip to content

GitLab Next

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
GitLab FOSS
GitLab FOSS
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 0
    • Merge Requests 0
  • Requirements
    • Requirements
    • List
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
  • GitLab.org
  • GitLab FOSSGitLab FOSS
  • Merge Requests
  • !29772

Closed
Opened Jun 17, 2019 by Mayra Cabrera@mayra-cabrera⚡Maintainer6 of 12 tasks completed6/12 tasks
  • Report abuse
Report abuse

WIP: Migrate Namespace#root_id column

  • Overview 9
  • Commits 1
  • Pipelines 5
  • Changes 6

What does this MR do?

Prework of https://gitlab.com/gitlab-org/gitlab-ce/issues/62214

Does this MR meet the acceptance criteria?

Conformity

  • Changelog entry
  • Documentation created/updated or follow-up review issue created
  • Code review guidelines
  • Merge request performance guidelines
  • Style guides
  • Database guides
  • Separation of EE specific content

Performance and testing

  • Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process.
  • [-] Tested in all supported browsers

Backend to do

  • 1. Add a new column on Namespaces: root_id
    • This new column should be NOT NULL, but we can't enforce that limit until we have migrated the data.
    • This new column will store the root namespace equal to the namespace ID, so the child namespaces will use the ID of the root namespace.
  • 2. Create a background migration to fill in Namespaces root_id
    • This migration would iterate over root namespaces only (parent_id = NULL), then run the usual CTE code to find all child nodes, then update all those.
  • 3. Include logic to fill root_id when a namespace is created/updated

Next iteration

  • Once the background migration has been completed, add another migration to include an index on root_id and to make it not null
Edited Jun 17, 2019 by Mayra Cabrera
Assignee
Assign to
Reviewer
Request review from
12.1
Milestone
12.1 (Past due)
Assign milestone
Time tracking
Reference: gitlab-org/gitlab-foss!29772
Source branch: 62214-namespace-database-migration