mirror of
https://github.com/IT4Change/gradido.git
synced 2026-03-01 12:44:43 +00:00
allow communties without users for migrate
This commit is contained in:
parent
0d8c5d2d19
commit
087a1f1070
@ -42,8 +42,11 @@ async function bootstrapCommunities(context: Context): Promise<Map<string, Commu
|
||||
})
|
||||
|
||||
generateKeyPairCommunity(communityDb, context.cache, topicId)
|
||||
let creationDate = communityDb.creationDate
|
||||
if (communityDb.userMinCreatedAt && communityDb.userMinCreatedAt < communityDb.creationDate) {
|
||||
// create community root transaction 1 minute before first user
|
||||
const creationDate = new Date(new Date(communityDb.userMinCreatedAt).getTime() - 1000 * 60)
|
||||
creationDate = new Date(new Date(communityDb.userMinCreatedAt).getTime() - 1000 * 60)
|
||||
}
|
||||
// community from db to community format the dlt connector normally uses
|
||||
const community = communityDbToCommunity(topicId, communityDb, creationDate)
|
||||
await addCommunityRootTransaction(blockchain, community)
|
||||
|
||||
@ -46,7 +46,7 @@ export const communityDbSchema = v.object({
|
||||
communityUuid: uuidv4Schema,
|
||||
name: v.string(),
|
||||
creationDate: dateSchema,
|
||||
userMinCreatedAt: dateSchema,
|
||||
userMinCreatedAt: v.nullish(dateSchema),
|
||||
uniqueAlias: v.string(),
|
||||
})
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user