feat(habits): add opt-in partial count carryover with daily reset defaults
This commit is contained in:
4
drizzle/0002_optional_count_carryover.sql
Normal file
4
drizzle/0002_optional_count_carryover.sql
Normal 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';
|
||||
Reference in New Issue
Block a user