Commit 0d0acb6
fix(BA-6915): drop the column default before retyping sessions.result
The downgrade recreates the plural sessionresults type and then retypes
sessions.result into it. PostgreSQL cannot cast an existing column default
across two unrelated enum types, so the ALTER aborts with
DatatypeMismatchError before touching a row. The migration's try/except
tolerates a list of expected divergence SQLSTATEs, and 42804 is not on it,
so the whole downgrade chain stops here.
Drop the default, retype, then restore it -- the order dec0deba5893 already
uses for the same conversion. The upgrade path runs the mirror-image ALTER
with the same omission, so it gets the same treatment.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent c181663 commit 0d0acb6
1 file changed
Lines changed: 19 additions & 8 deletions
File tree
- src/ai/backend/manager/models/alembic/versions
Lines changed: 19 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
44 | 61 | | |
45 | 62 | | |
46 | 63 | | |
| |||
62 | 79 | | |
63 | 80 | | |
64 | 81 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
| 82 | + | |
69 | 83 | | |
70 | 84 | | |
71 | 85 | | |
| |||
102 | 116 | | |
103 | 117 | | |
104 | 118 | | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
| 119 | + | |
109 | 120 | | |
110 | 121 | | |
111 | 122 | | |
| |||
0 commit comments