Add unique constraints to prevent person_documnt and accompanyingcourse_document with duplicated object_id

This change ensures `object_id` uniqueness within `person_document` and `accompanyingcourse_document` tables. It includes migration scripts and entity annotations to enforce these constraints. This helps maintain data integrity and consistency across the database.
This commit is contained in:
2024-11-19 10:50:46 +01:00
parent 9a44cf060f
commit 4be6c09d4d
4 changed files with 44 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
#[ORM\Table('chill_doc.accompanyingcourse_document')]
#[ORM\UniqueConstraint(name: 'acc_course_document_unique_stored_object', columns: ['object_id'])]
class AccompanyingCourseDocument extends Document implements HasScopesInterface, HasCentersInterface
{
#[ORM\ManyToOne(targetEntity: AccompanyingPeriod::class)]