Skip to content
Unverified Commit b288c877 authored by Christian Bruckmayer's avatar Christian Bruckmayer
Browse files

[webui][api] Fix ChangeRepositoriesRemoteProjectNameToNotNull migration

The migration ChangeRepositoriesRemoteProjectNameToNotNull changes the default
of remote_project_name to '' instead of NULL.
This was necessary in order to make the combination of remote_project_name,
db_project_id and name unique because MySQL does not consider rows with same column content
but one NULL value as equal. The migration back then was removing duplicates, however,
it also migrated repositories which are associated with remote projects. These
repositories do not need to get migrated as they're anyway unique
(there can not be a NULL value for these repositories).

This commit splits this migration in a schema and a data migration and introduces specs
for the data migration.
The data migration gets changed to NOT migrate repositories of a remote project.
If there is duplicate repository found, we simply destroy it as the data is already inconsistent
and it is not possible to do a full migration.

Fix #4761.
parent d187c4c7
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment