feat(habits): add opt-in partial count carryover with daily reset defaults

This commit is contained in:
syntaxbullet
2026-09-04 09:11:11 +02:00
parent e9cc591576
commit 9a7180ce78
9 changed files with 775 additions and 14 deletions

View File

@@ -0,0 +1,4 @@
ALTER TABLE `habit_days` ADD `count_set` integer DEFAULT false NOT NULL;--> statement-breakpoint
UPDATE habit_days SET count_set = 1 WHERE count != 0 OR EXISTS (SELECT 1 FROM progress_events e WHERE e.day_id = habit_days.id AND json_type(e.after, '$.count') IS NOT NULL);
--> statement-breakpoint
UPDATE habit_revisions SET config = json_set(config, '$.carryPartialProgress', json('false')) WHERE json_extract(config, '$.method') = 'count';