Commit ce65712
committed
Better sqlite timestamp default and pruning query
The `CURRENT_TIMESTAMP` type lacks a trailing `z`, which causes it to be
compared incorrectly against UTC datetimes. Any jobs inserted without a
`scheduled_at`, where the default is used, could be returned in queries
that compare against a `DateTime`.
This prevents the issue in the future two ways:
1. Switch the default `inserted_at/scheduled_at` timestamp to a format
that can be queried properly.
2. Change the pruning check to use `completed_at` rather than
`scheduled_at` for existing databases. This is a more accurate query
that was avoided before because it didn't match the `Basic` engine.
Closes #13911 parent 88f6557 commit ce65712
2 files changed
+8
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
| |||
0 commit comments