# Collection Item Index

The unique_item index is added to the f_collection_item table. This index ensures that each file is only once in a collection.

To check whether the index is applied correctly use the following SQL command:

Mysql:

SHOW INDEX FROM f_collection_item FROM 4allportal

Mssql

EXEC sp_helpindex 4allportal.dbo.f_collection_item

To be applied to the table the index requires a config reload in a proper database state. In this state no two items with the same file id and collection id are allowed. To reach this state an update statement is executed after updating the DAM which permanently deletes all entries in the f_collection_item which are already soft-deleted (deleted = 1). If there is still a file multiple times in a collection, this file has to be removed manually.

The following statement can be used to find these duplicates:

MySql :

SELECT file,collection 
FROM f_collection_item 
GROUP BY file,collection 
HAVING COUNT(*) > 1

Mssql :

SELECT [file],collection 
FROM f_collection_item 
GROUP BY [file],collection 
HAVING COUNT(*) > 1

Soft-Delete is no longer supported for f_collection_item table. Of course, it is still possible to undo the deleting of files from the file module.

Request missing documentation