Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No foreign key in sqlite #7930

Closed
fmathieu1 opened this issue Nov 28, 2019 · 2 comments
Closed

No foreign key in sqlite #7930

fmathieu1 opened this issue Nov 28, 2019 · 2 comments
Assignees
Milestone

Comments

@fmathieu1
Copy link

fmathieu1 commented Nov 28, 2019

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

@spideyfusion
Copy link

We are running into the same issue on one of our projects where we use the SQLite platform in our test environment because it's easier to bootstrap than e.g. MySQL.

The issue appears to be caused by this change: #7842

@lcobucci
Copy link
Member

Handled by #7937 to be released soon 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants