feat: ability to hide underdue tasks

This commit is contained in:
Robert Perce 2026-05-31 22:02:32 -05:00
parent a7c74feb63
commit ed8a5dae9c
16 changed files with 341 additions and 110 deletions

View file

@ -23,3 +23,18 @@ insert into tasks (description, frequency_id) values
('Wash dish rack', 6),
('Oil hinges', 7),
('Wash patio', 7);
insert into completions (task_id, datestamp) values
(1, date('now', '-7 days')),
(2, date('now', '-3 days')),
(3, date('now', '-11 days')),
(4, date('now', '-3 days')),
(6, date('now', '-13 days')),
(7, date('now', '-18 days')),
(8, date('now', '-35 days')),
(9, date('now', '-22 days')),
(10, date('now', '-43 days')),
(12, date('now', '-69 days')),
(13, date('now', '-43 days')),
(15, date('now', '-95 days')),
(17, date('now', '-204 days'));

View file

@ -0,0 +1,36 @@
-- foreign_keys can only up/down outside of transactions
-- so we first pre-commit the one started by sqlx...
COMMIT TRANSACTION;
-- turn off foreign keys...
PRAGMA foreign_keys=OFF;
-- start our own transaction...
BEGIN TRANSACTION;
create table if not exists __replace_frequencies (
id integer primary key autoincrement,
description text not null default '',
target_period number not null
);
insert into __replace_frequencies (id, description, target_period) values
(1, 'daily', 1),
(2, 'weekly', 7),
(3, 'fortnightly', 14),
(4, 'monthly', 30),
(5, 'seasonally', 91),
(6, 'semiannually', 182),
(7, 'yearly', 365);
drop table frequencies;
alter table __replace_frequencies rename to frequencies;
PRAGMA foreign_key_check;
-- commit our own transaction...
COMMIT TRANSACTION;
-- put our own pragmas back...
PRAGMA foreign_keys=ON;
-- and start a dummy transaction so sqlx's COMMIT doesn't explode
BEGIN TRANSACTION;

View file

@ -0,0 +1,7 @@
create table if not exists settings (
id integer primary key,
show_underdue boolean not null default true
);
insert into settings (id) values (1) on conflict (id) do nothing;