你刚刷到这条消息,本来准备顺手划走,但又怕自己错过了真正会影响下一步判断的那一点。

最容易做错的,是sqlite-utils 4.1.1;代价往往是如果只盯表面热闹,你很容易在错误方向上花掉时间、预算和注意力。;我先给一个保守判断:4.1.1是在防你改表时误删关联数据。

My conservative read: 4.1.1 is there to stop you from accidentally deleting related data when you change a table. In plain English, it blocks a 工作流程(workflow) that feels safer because it is inside a transaction, but is not actually safe in this specific setup.

The key detail is narrow, not dramatic. The schema-change helper rebuilds a table by dropping the old one, and 4.1.1 now raises TransactionError instead of continuing when foreign key checks are on and the change is already inside a transaction.[S001]

Why that matters: foreign key rules keep related tables in sync, and they cannot be turned off in the middle of a transaction.[S002] So if other tables point at the old table with CASCADE, SET NULL, or SET DEFAULT, that drop step can trigger destructive side effects. 4.1.1 first blocks the silent cascading delete path instead of letting the "wrapped in a transaction" feeling fool you.

An update is worth reading not because it adds more bullets, but because it changes your next decision. This is about sqlite-utils 4.1.1, table-rebuild transforms, foreign keys enabled, and an already-open transaction. It is not a general SQLite data-loss bug, and it will not affect every migration.

If your team touches SQLite migrations on referenced tables, audit those transform paths before you assume the wrapper is safe. Share this with the person who still reads a patch release as routine housekeeping.

真正该讨论的是:sqlite-utils 4.1.1