Commit 11d80e0
authored
When getting tables to truncate, panic on unknown version (#1198)
This one's related to code review feedback here [1]. When getting a list
of tables that need to be truncated for the `TestSchema` helpers, it was
possible to receive migration versions that didn't exist and the
function would tolerate it, returning the latest known list of tables.
This often works, but even where it does there's some risk of a new
table coming in that doesn't end up getting cleaned up properly.
Here, panic when receiving an unknown version number so that the problem
can be corrected immediately. The panic may seem undesirable, but these
functions are only used in tests, so it should be fine.
[1] riverqueue/riverpro#281 (comment)1 parent fd65906 commit 11d80e0
File tree
2 files changed
+18
-2
lines changed- riverdriver
2 files changed
+18
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
865 | 866 | | |
866 | 867 | | |
867 | 868 | | |
| 869 | + | |
868 | 870 | | |
869 | 871 | | |
870 | 872 | | |
871 | 873 | | |
872 | 874 | | |
873 | 875 | | |
874 | 876 | | |
| 877 | + | |
| 878 | + | |
875 | 879 | | |
876 | 880 | | |
877 | | - | |
878 | | - | |
| 881 | + | |
879 | 882 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
253 | 266 | | |
254 | 267 | | |
255 | 268 | | |
| |||
0 commit comments