似乎当我在 SQLite 管理器下的结构页面上使用“编辑列”命令修改表中的列定义(不是主键列)时,sqlite3 从其 sqlite_sequence 表中删除了该表名。我尝试手动将其添加回去,但发现在添加到丢失的表中时序列号没有得到更新。
有谁知道如何恢复丢失的表名?
最佳答案
sqlite_sequence documentation说:
If the sqlite_sequence.seq value for an AUTOINCREMENT table is manually set to something other than an integer and there is a subsequent attempt to insert the or update the AUTOINCREMENT table, then the behavior is undefined.
但是:
If the sqlite_sequence row for an AUTOINCREMENT table does not exist when the AUTOINCREMENT table is updated, then a new sqlite_sequence row is created.
所以你不应该在 sqlite_sequence 中添加一个“假的”条目,但是如果它存在你可以改变它。
关于sqlite - 我在 sqlite_sequence 表中丢失了一个表名。我该如何恢复它?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12495180/