Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@
[#463](https://github.com/nextcloud/cookbook/pull/463/) @seyfeb
- Fixed cooking time being removed if recipe is saved, fixes #472
[#473](https://github.com/nextcloud/cookbook/pull/473/) @seyfeb
- Remove keywords from database when a recipe is removed
[#478](https://github.com/nextcloud/cookbook/pull/478) @christianlupus

### Removed
- Travis build system
Expand Down
6 changes: 6 additions & 0 deletions lib/Db/RecipeDb.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,16 @@ public function deleteRecipeById(int $id) {

$qb->execute();

$qb = $this->db->getQueryBuilder();

$qb->delete(self::DB_TABLE_KEYWORDS)
->where('recipe_id = :id');
$qb->setParameter('id', $id, IQueryBuilder::PARAM_INT);

$qb->execute();

$qb = $this->db->getQueryBuilder();

$qb->delete(self::DB_TABLE_CATEGORIES)
->where('recipe_id = :id');
$qb->setParameter('id', $id, IQueryBuilder::PARAM_INT);
Expand Down