Add unique_together and manage transaction for integry on database retrieve