mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-23 03:22:19 +03:00
add migration for icons with typo in it (#3478)
Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
parent
2869a8e189
commit
352404533b
@ -76,10 +76,21 @@ async function createDefaults (tx: TxOperations): Promise<void> {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function fixProjectIcons (tx: TxOperations): Promise<void> {
|
||||||
|
// @ts-expect-error
|
||||||
|
const projectsWithWrongIcon = await tx.findAll(tracker.class.Project, { icon: 'tracker:component:IconWithEmojii' })
|
||||||
|
const promises = []
|
||||||
|
for (const project of projectsWithWrongIcon) {
|
||||||
|
promises.push(tx.update(project, { icon: tracker.component.IconWithEmoji }))
|
||||||
|
}
|
||||||
|
await Promise.all(promises)
|
||||||
|
}
|
||||||
|
|
||||||
export const trackerOperation: MigrateOperation = {
|
export const trackerOperation: MigrateOperation = {
|
||||||
async migrate (client: MigrationClient): Promise<void> {},
|
async migrate (client: MigrationClient): Promise<void> {},
|
||||||
async upgrade (client: MigrationUpgradeClient): Promise<void> {
|
async upgrade (client: MigrationUpgradeClient): Promise<void> {
|
||||||
const tx = new TxOperations(client, core.account.System)
|
const tx = new TxOperations(client, core.account.System)
|
||||||
await createDefaults(tx)
|
await createDefaults(tx)
|
||||||
|
await fixProjectIcons(tx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user