When these indexes are not unique, we will have to query 3 times in order to avoid duplication in these tables (check, insert, get id) when a record does not exist.
This is due a limitation in MW DBAL as there's no way yet to get the last insert id. This can be addded. However, making these indexes unique is both desirable and consistent with the purpose of preventing duplication in these tables.