diff --git a/src/function/cleanup/delete-families.ts b/src/function/cleanup/delete-families.ts index 514a553..b5856a6 100644 --- a/src/function/cleanup/delete-families.ts +++ b/src/function/cleanup/delete-families.ts @@ -1,6 +1,6 @@ /* * server component for the TimeLimit App - * Copyright (C) 2019 - 2022 Jonas Lochmann + * Copyright (C) 2019 - 2023 Jonas Lochmann * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -79,6 +79,16 @@ export async function deleteFamilies ({ database, familiyIds }: { transaction }) + // session durations + await database.sessionDuration.destroy({ + where: { + familyId: { + [Sequelize.Op.in]: familiyIds + } + }, + transaction + }) + // user await database.user.destroy({ where: {