migration improvement (#5614)

Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
Vyacheslav Tumanov 2024-05-17 16:56:16 +05:00 committed by GitHub
parent 7128585f05
commit d91c3e5a44
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -368,6 +368,18 @@ async function migrateIssueStatuses (client: MigrationClient): Promise<void> {
}
}
)
await client.update(
DOMAIN_TX,
{
objectClass: core.class.Status,
'attributes.ofAttribute': tracker.attribute.IssueStatus
},
{
$set: {
objectClass: tracker.class.IssueStatus
}
}
)
await client.update(
DOMAIN_STATUS,
@ -386,6 +398,10 @@ async function migrateIssueStatuses (client: MigrationClient): Promise<void> {
export const trackerOperation: MigrateOperation = {
async preMigrate (client: MigrationClient, logger: ModelLogger): Promise<void> {
await tryMigrate(client, trackerId, [
{
state: 'fixIncorrectIssueStatuses',
func: migrateIssueStatuses
},
{
state: 'migrate-default-statuses',
func: (client) => migrateDefaultStatuses(client, logger)
@ -402,10 +418,6 @@ export const trackerOperation: MigrateOperation = {
state: 'passIdentifierToParentInfo',
func: passIdentifierToParentInfo
},
{
state: 'fixIncorrectIssueStatuses',
func: migrateIssueStatuses
},
{
state: 'statusesToModel-2',
func: migrateStatusesToModel