0
在教義我有一個多對多的關聯如何實現獨特的多對多的學說
Document:
manyToMany:
tags:
targetEntity: Tag
inversedBy: tags
joinTable:
name: documents_tags
Tag:
manyToMany:
documents:
targetEntity: Document
mappedBy: tags
並創建一個新表documents_tags
與document_id+tag_id
一個主鍵,在他們每個人的正常鍵。但我想對兩列tag_id
和document_id
有一個唯一的鍵約束。我怎麼能做到這一點?