Fixed chore upgrade handling when having nonsensical user data (fixes #1826)

This commit is contained in:
Bernd Bestel
2022-03-23 17:17:39 +01:00
parent 23f285c3fb
commit dce14b8999
2 changed files with 2 additions and 1 deletions

View File

@@ -33,6 +33,7 @@
- The `Daily` period type has been changed to schedule the chore at the _same time_ (based on the start date) each `n` days
- This period type scheduled chores `n` days _after the last execution_ before, which is also possible by using the `Hourly` period type and a corresponding period interval; all existing `Daily` schedules will be converted to that on migration
- Fixed that when consuming a parent product on chore execution (chore option "Consume product on chore execution"), no child products were used if the parent product itself is not in-stock
- Fixed that the upgrade to v3.2.0 failed when having any former "Dynamic Regular" chore with a "Period interval" of `0` (which makes absolutely no sense in reality)
### Calendar

View File

@@ -1,6 +1,6 @@
UPDATE chores
SET period_type = 'daily',
period_interval = period_days,
period_interval = CASE WHEN IFNULL(period_days, 0) = 0 THEN 1 ELSE period_days END,
period_days = null
WHERE period_type = 'dynamic-regular';