解决方法
如果您正在使用ALTER TABLE和RENAME TO重命名表,那么如
this page(来自sqlite文档)所述,索引仍然有效:
The ALTER TABLE command in sqlite allows the user to rename a table […] If the table being renamed has triggers or indices,then these remain attached to the table after it has been renamed.
但请注意,不允许重命名列.这是SQL features not implemented by sqlite之一:
Only the RENAME TABLE and ADD COLUMN variants of the ALTER TABLE command are supported. Other kinds of ALTER TABLE operations such as DROP COLUMN,ALTER COLUMN,ADD CONSTRAINT,and so forth are omitted.