Skip to content

Commit e634982

Browse files
committed
Add onDelete CASCADE to AbstractPageData.page_id FK
Without this, the fixture purger cannot delete Pages while AbstractPageData rows still reference them via page_id (PostgreSQL RESTRICT default). CASCADE is the correct semantic: a PageData without its template Page is meaningless and should be removed with it.
1 parent a209f81 commit e634982

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Entity/Core/AbstractPageData.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
abstract class AbstractPageData extends AbstractPage implements PageDataInterface
3939
{
4040
#[ORM\ManyToOne(targetEntity: Page::class)]
41-
#[ORM\JoinColumn(name: 'page_id', nullable: false)]
41+
#[ORM\JoinColumn(name: 'page_id', nullable: false, onDelete: 'CASCADE')]
4242
#[Assert\NotBlank(message: 'Please select a page template')]
4343
#[Groups(['Route:manifest:read'])]
4444
public Page $page;

0 commit comments

Comments
 (0)