Marc-André Bombeck
bb1e01e456
fix(medications): restore the containers the in-use clock wrongly wrote off
...
Migration 0276 reverses the rows that reached EXPIRED only through the
post-opening clock on a container that never had one. It moves a row back to
IN_USE when an opening date is recorded and ACTIVE when none is, and sets
`expires_at` from the printed expiry — which for these rows is usually
nothing at all, because they recorded none.
The predicate is exact rather than approximate: nothing but the printed
expiry and the in-use clock can write EXPIRED, so a clock-less container
whose printed expiry is absent or still ahead can only have got there through
the clock. Pens and ampoules keep their EXPIRED, so does anything whose
printed date genuinely lapsed, and so does a drained container. No date is
invented and no printed expiry is fabricated.
The integration test seeds the before-state, applies the migration SQL from
disk, and asserts both what moves and what stays — the testcontainer starts
empty, so the migration running at boot proves nothing on its own.
2026-07-26 18:00:07 +02:00
..
2026-05-10 10:34:32 +02:00
2026-05-09 21:00:23 +02:00
2026-07-25 15:20:47 +02:00
2026-05-09 20:46:20 +02:00
2026-07-20 13:42:38 +02:00
2026-07-20 12:24:15 +02:00
2026-06-27 20:37:35 +02:00
2026-06-19 22:20:31 +02:00
2026-05-10 11:05:40 +02:00
2026-06-19 22:20:31 +02:00
2026-06-28 19:26:16 +02:00
2026-06-14 14:26:58 +02:00
2026-07-04 14:46:19 +02:00
2026-05-16 19:46:43 +02:00
2026-05-14 23:49:32 +02:00
2026-05-24 22:22:30 +02:00
2026-07-16 08:48:41 +02:00
2026-07-21 13:08:28 +02:00
2026-07-14 11:56:29 +02:00
2026-07-22 04:14:15 +02:00
2026-07-19 11:41:12 +02:00
2026-07-19 11:40:56 +02:00
2026-07-18 02:09:33 +02:00
2026-07-19 01:07:43 +02:00
2026-06-28 14:00:55 +02:00
2026-07-20 00:40:20 +02:00
2026-06-14 14:26:58 +02:00
2026-06-19 22:20:31 +02:00
2026-06-27 22:40:01 +02:00
2026-06-27 20:37:35 +02:00
2026-05-10 11:05:40 +02:00
2026-07-21 01:34:29 +02:00
2026-06-19 22:20:31 +02:00
2026-06-26 14:17:36 +02:00
2026-07-16 23:32:28 +02:00
2026-05-10 16:11:12 +02:00
2026-05-11 02:38:17 +02:00
2026-07-24 18:28:41 +02:00
2026-06-01 19:54:26 +02:00
2026-07-15 22:49:07 +02:00
2026-07-25 21:57:06 +02:00
2026-06-19 22:20:31 +02:00
2026-06-19 22:20:31 +02:00
2026-07-20 00:40:20 +02:00
2026-07-17 14:29:07 +02:00
2026-07-17 14:29:07 +02:00
2026-07-20 12:24:15 +02:00
2026-07-26 00:45:08 +02:00
2026-07-26 00:45:08 +02:00
2026-07-08 22:05:05 +02:00
2026-07-22 04:14:15 +02:00
2026-07-21 13:08:28 +02:00
2026-07-21 00:36:40 +02:00
2026-05-10 00:11:36 +02:00
2026-06-22 09:00:39 +02:00
2026-06-22 09:00:39 +02:00
2026-07-19 13:40:03 +02:00
2026-07-21 00:36:40 +02:00
2026-05-09 18:08:11 +02:00
2026-06-19 22:20:31 +02:00
2026-05-10 01:30:06 +02:00
2026-05-10 11:05:40 +02:00
2026-06-28 19:23:57 +02:00
2026-06-19 22:20:31 +02:00
2026-07-07 15:55:50 +02:00
2026-06-19 22:20:31 +02:00
2026-06-11 02:19:28 +02:00
2026-07-25 11:36:18 +02:00
2026-07-26 14:19:13 +02:00
2026-07-26 18:00:07 +02:00
2026-07-26 14:37:57 +02:00
2026-06-28 02:00:37 +02:00
2026-07-25 15:03:44 +02:00
2026-06-19 22:20:31 +02:00
2026-06-19 22:20:31 +02:00
2026-05-16 10:59:42 +02:00
2026-05-31 14:36:17 +02:00
2026-07-25 15:03:44 +02:00
2026-06-19 22:20:31 +02:00
2026-07-26 00:45:08 +02:00
2026-06-19 22:20:31 +02:00
2026-06-10 11:18:00 +02:00
2026-07-26 16:37:10 +02:00
2026-07-26 16:37:10 +02:00
2026-07-26 14:37:57 +02:00
2026-06-19 22:20:31 +02:00
2026-07-25 18:41:40 +02:00
2026-06-27 19:56:30 +02:00
2026-05-09 18:08:11 +02:00
2026-06-14 11:31:52 +02:00
2026-06-05 03:45:04 +02:00
2026-06-27 19:33:10 +02:00
2026-06-19 22:20:31 +02:00
2026-06-19 22:20:31 +02:00
2026-06-27 19:33:10 +02:00
2026-07-14 13:10:47 +02:00
2026-07-25 11:36:18 +02:00
2026-06-19 22:20:31 +02:00
2026-05-14 23:49:32 +02:00
2026-07-26 14:37:57 +02:00
2026-07-22 04:14:15 +02:00
2026-07-19 02:31:45 +02:00
2026-05-08 17:46:31 +02:00
2026-07-14 11:56:29 +02:00
2026-06-26 13:24:30 +02:00
2026-06-19 22:20:31 +02:00
2026-07-23 15:16:48 +02:00
2026-07-19 13:48:46 +02:00
2026-05-21 23:13:21 +02:00
2026-07-26 14:04:44 +02:00
2026-07-23 09:04:43 +02:00
2026-07-07 22:00:14 +02:00
2026-07-26 14:04:44 +02:00
2026-06-04 10:05:47 +02:00
2026-05-24 22:22:30 +02:00
2026-07-15 22:49:07 +02:00
2026-07-19 14:29:34 +02:00
2026-07-26 14:04:44 +02:00
2026-06-19 22:20:31 +02:00
2026-07-22 04:14:15 +02:00
2026-06-19 22:20:31 +02:00
2026-06-05 08:10:13 +02:00
2026-07-22 04:14:15 +02:00
2026-05-17 15:36:38 +02:00
2026-07-18 02:30:33 +02:00
2026-05-24 22:22:30 +02:00
2026-05-14 23:49:32 +02:00
2026-05-17 15:36:38 +02:00
2026-07-22 04:14:15 +02:00
2026-07-22 04:14:15 +02:00
2026-07-20 00:40:20 +02:00