max / makenotwork
1 file changed,
+9 insertions,
-6 deletions
| @@ -82,12 +82,15 @@ macro_rules! impl_str_enum { | |||
| 82 | 82 | } | |
| 83 | 83 | ||
| 84 | 84 | impl $enum_name { | |
| 85 | - | /// Every wire/DB string this enum maps to. The single source of truth | |
| 86 | - | /// for the variant set; the enum-drift test asserts it equals the | |
| 87 | - | /// Postgres `CHECK (... IN (...))` list for each backing column, so a | |
| 88 | - | /// variant added here without widening the DB constraint (or vice | |
| 89 | - | /// versa) fails at test time instead of at the first read of a | |
| 90 | - | /// poisoned row. | |
| 85 | + | /// Every wire/DB string this enum maps to — the single source of | |
| 86 | + | /// truth for the variant set. For each enum *registered* in the | |
| 87 | + | /// enum-drift integration test (`tests/workflows/enum_drift.rs`), | |
| 88 | + | /// this set is asserted equal to the Postgres `CHECK (... IN (...))` | |
| 89 | + | /// list on its backing column, so a variant added here without | |
| 90 | + | /// widening the DB constraint (or vice versa) fails at test time | |
| 91 | + | /// rather than at the first read of a poisoned row. Coverage is that | |
| 92 | + | /// registry, not every enum automatically: add a `(enum, table, | |
| 93 | + | /// column)` row there when a new CHECK-constrained column lands. | |
| 91 | 94 | pub const VARIANTS: &'static [&'static str] = &[$($str),+]; | |
| 92 | 95 | } | |
| 93 | 96 | }; |