Internally, SQLite assumes that indices stored in database files are sorted according to the collation sequence indicated by the SQL schema. Changing the definition of a collation sequence after an index has been built is therefore equivalent to database corruption.
- Unique 1)
CREATE UNIQUE INDEX IndexName ON TableName (colName1, ...);
Indexes can use:
- order (ie ASC/DESC)
- and COLLATE
'drop' 'index' ['if' 'exists'] [ 'schema-name' '.'] 'index-name'
There is no alter index statement support. You need to drop and create again.
SELECT DISTINCT m.name || '.' || ii.name AS 'indexed-columns' FROM sqlite_master AS m, pragma_index_list(m.name) AS il, pragma_index_info(il.name) AS ii WHERE m.type='table' ORDER BY 1;