mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-13 03:40:48 +00:00
Allow to upgrade all workspaces (#1073)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
5435c4162d
commit
7dba8c4f38
@ -119,6 +119,19 @@ program
|
||||
})
|
||||
})
|
||||
|
||||
program
|
||||
.command('upgrade')
|
||||
.description('upgrade')
|
||||
.action(async (cmd) => {
|
||||
return await withDatabase(mongodbUri, async (db) => {
|
||||
const workspaces = await listWorkspaces(db)
|
||||
for (const ws of workspaces) {
|
||||
console.log('---UPGRADING----', ws.workspace)
|
||||
await upgradeWorkspace(db, ws.workspace)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
program
|
||||
.command('drop-workspace <name>')
|
||||
.description('drop workspace')
|
||||
|
@ -199,9 +199,13 @@ async function createUpdateIndexes (connection: CoreClient, db: Db): Promise<voi
|
||||
|
||||
for (const [d, v] of domains.entries()) {
|
||||
const collection = db.collection(d)
|
||||
const bb: string[] = []
|
||||
for (const vv of v.values()) {
|
||||
console.log('creating index', d, vv)
|
||||
await collection.createIndex(vv)
|
||||
bb.push(vv)
|
||||
}
|
||||
if (bb.length > 0) {
|
||||
console.log('created indexes', d, bb)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user