Commit d3b642b
fix: DROP and recreate H2 tables on cache version mismatch
CREATE TABLE IF NOT EXISTS doesn't add new columns to existing tables.
When the schema changes (new status/detection_method/file_type/snippet
columns), old H2 databases kept the old schema and MERGE INTO failed
with "Column STATUS not found".
Fix: on version mismatch, DROP all tables and recreate from SCHEMA_SQL
instead of just deleting rows. This ensures new columns are always
present after a schema upgrade.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 1ef97f3 commit d3b642b
1 file changed
Lines changed: 17 additions & 5 deletions
Lines changed: 17 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
| 157 | + | |
158 | 158 | | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
163 | 175 | | |
164 | 176 | | |
165 | 177 | | |
| |||
0 commit comments