mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
should prevent crash in empty tables
This commit is contained in:
parent
90c51596a1
commit
d53073783c
@ -13,7 +13,7 @@ export async function upgrade(queryFn: (query: string, values?: any[]) => Promis
|
||||
// read the community uuid of the homeCommunity
|
||||
const result = await queryFn(`SELECT c.community_uuid from communities as c WHERE c.foreign = 0`)
|
||||
// and if uuid exists enter the home_community_uuid for sender and recipient of each still existing transaction
|
||||
if (result[0]) {
|
||||
if (result && result[0]) {
|
||||
await queryFn(
|
||||
`UPDATE transactions as t SET t.user_community_uuid = "${result[0].community_uuid}" WHERE t.user_id IS NOT NULL AND t.user_community_uuid IS NULL`,
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user