Instead of splitting SQL on semicolons (fragile — semicolons appear inside
comments and string literals), use executescript() for correct tokenization.
On 'duplicate column name' error (caused by a prior partial run that
auto-committed some ALTER TABLE statements before crashing), strip the
already-applied ADD COLUMN statement from the script and retry. Limit
to 20 attempts to prevent infinite loops on genuinely broken SQL.
This replaces the earlier per-statement split approach which broke on
migration 004 comment text containing a semicolon inside a -- comment,
causing the remainder ('one row per...') to be treated as raw SQL.
|
||
|---|---|---|
| .. | ||
| affiliates | ||
| api | ||
| config | ||
| db | ||
| documents | ||
| hardware | ||
| llm | ||
| manage | ||
| pipeline | ||
| preferences | ||
| tasks | ||
| tiers | ||
| vision | ||
| wizard | ||
| __init__.py | ||