Skip to content

No foreign key in sqlite #7930

@fmathieu1

Description

@fmathieu1

Bug Report

Q A
BC Break Yes
Version >=2.6.5

Summary

Since I upgraded doctrine/orm to 2.6.5 from 2.6.3 I no longer have foreign keys on my SQLite.
I tried version 2.6.4 and it works as expected.

Current behavior

I can no longer use onDelete="CASCADE" and such

How to reproduce

Given my Category entity, referencing itself as parent

class Category 
{
    /**
     * @var Category|null
     *
     * @ORM\ManyToOne(targetEntity="Category")
     * @ORM\JoinColumns({
     *     @ORM\JoinColumn(name="parent_id", referencedColumnName="id", nullable=true, onDelete="CASCADE")
     * })
     */
    private $parent;

}

Expected behavior

i can use onDelete="CASCADE" to have children removed when a parent is removed

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions