PRAGMA writable_schema allows you to change the database schema behind SQLite back and thereby violate the restrictions:
$ sqlite3 test.db > CREATE TABLE t(x); > CREATE INDEX tx ON t(x); > INSERT INTO t VALUES (1), (1); > PRAGMA writable_schema = 1; > UPDATE sqlite_master > SET sql = 'CREATE UNIQUE INDEX tx ON t(x)' > WHERE type = 'index' AND name = 'tx'; > .quit $ sqlite3 test.db # reload > PRAGMA integrity_check; non-unique entry in index tx
source share