mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge branch 'master' into federation-remove-export
This commit is contained in:
commit
6d83680f12
@ -66,8 +66,6 @@ export async function upgrade(queryFn: (query: string, values?: any[]) => Promis
|
||||
)
|
||||
}
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-empty-function */
|
||||
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
|
||||
export async function downgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
|
||||
await queryFn('ALTER TABLE `transactions` DROP COLUMN `user_gradido_id`;')
|
||||
await queryFn('ALTER TABLE `transactions` DROP COLUMN `user_name`;')
|
||||
|
||||
@ -250,14 +250,11 @@ async function writeHomeCommunityEntry(pubKey: string): Promise<void> {
|
||||
}
|
||||
|
||||
const newCommunityUuid = async (): Promise<string> => {
|
||||
let uuid: string
|
||||
let countIds: number
|
||||
do {
|
||||
uuid = uuidv4()
|
||||
countIds = await DbCommunity.count({ where: { communityUuid: uuid } })
|
||||
if (countIds > 0) {
|
||||
logger.info('CommunityUuid creation conflict...')
|
||||
while (true) {
|
||||
const communityUuid = uuidv4()
|
||||
if ((await DbCommunity.count({ where: { communityUuid } })) === 0) {
|
||||
return communityUuid
|
||||
}
|
||||
logger.info('CommunityUuid creation conflict...', communityUuid)
|
||||
}
|
||||
} while (countIds > 0)
|
||||
return uuid
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user