Skip to content

Backfill namespace DB entries with correct UserNamespace type

What does this MR do and why?

As part of this epic, we need to update all rows in the namespaces table whose type == NULL, and replace it with User

The namespaces table is an STI table, that originally only supported nil for a user namespace, and Group for Groups. As we're adding support for ProjectNamespace, we are also consolidating the user namespace into UserNamespace.

The following steps have already been completed:

Database

up

$ brake db:migrate:up VERSION=20210930211936
== 20210930211936 BackfillUserNamespace: migrating ============================
unknown OID 28: failed to recognize type of 'relfrozenxid'. It will be treated as String.
unknown OID 1034: failed to recognize type of 'relacl'. It will be treated as String.
unknown OID 194: failed to recognize type of 'relpartbound'. It will be treated as String.
== 20210930211936 BackfillUserNamespace: migrated (0.0292s) ===================

down

$ brake db:migrate:down VERSION=20210930211936
== 20210930211936 BackfillUserNamespace: reverting ============================
== 20210930211936 BackfillUserNamespace: reverted (0.0069s) ===================

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #341069 (closed)

Edited by charlie ablett

Merge request reports