mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
14 lines
496 B
TypeScript
14 lines
496 B
TypeScript
export async function upgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
|
|
await queryFn(
|
|
`UPDATE \`transactions\` AS t
|
|
JOIN \`contributions\` AS c ON t.id = c.transaction_id
|
|
SET t.linked_user_id = c.confirmed_by
|
|
WHERE t.type_id = ?`,
|
|
[1],
|
|
)
|
|
}
|
|
|
|
export async function downgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
|
|
await queryFn(`UPDATE \`transactions\` SET \`linked_user_id\` = NULL where \`type_id\` = ?;`, [1])
|
|
}
|