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

SchemaTool generates extra diff for platforms without FK support #7841

Closed
vpArth opened this issue Sep 30, 2019 · 1 comment
Closed

SchemaTool generates extra diff for platforms without FK support #7841

vpArth opened this issue Sep 30, 2019 · 1 comment
Assignees
Labels
Milestone

Comments

@vpArth
Copy link
Contributor

vpArth commented Sep 30, 2019

Bug Report

SchemaTool generates extra diff for platforms without FK support(ex: SqlitePlatform)

Q A
BC Break no
Version all

Summary

SchemaTool::getUpdateSchemaSql is never empty, because MetaData contains foreign keys adding, but SqlitePlatform has not support of them

How to reproduce

/** @ORM\Entity */
class A {
    /** @ORM\Id @ORM\Column(type="integer") @ORM\GeneratedValue */
    public $id;
    /** @ORM\OneToMany(targetEntity=B::class, mappedBy="parent") */
    public $children;
}
/** @ORM\Entity */
class B {
    /** @ORM\Id @ORM\Column(type="integer") @ORM\GeneratedValue */
    public $id;
    /** @ORM\ManyToOne(targetEntity=A::class) */
    public $parent;
}
// ...
    $class = $em->getClassMetadata(B::class);
    $schemaTool->updateSchema([$class]);
    $diff = $schemaTool->getUpdateSchemaSql([$class]);

Current behavior

count($diff) > 0;

Expected behavior

count($diff) === 0;
vpArth added a commit to vpArth-php/orm that referenced this issue Sep 30, 2019
vpArth added a commit to vpArth-php/orm that referenced this issue Sep 30, 2019
Also add skip for DDC-2138 for non-fk-supporting platforms
vpArth added a commit to vpArth-php/orm that referenced this issue Sep 30, 2019
vpArth added a commit to vpArth-php/orm that referenced this issue Sep 30, 2019
vpArth added a commit to vpArth-php/orm that referenced this issue Oct 1, 2019
@lcobucci lcobucci added the Bug label Oct 1, 2019
vpArth added a commit to vpArth-php/orm that referenced this issue Oct 2, 2019
vpArth added a commit to vpArth-php/orm that referenced this issue Oct 2, 2019
vpArth added a commit to vpArth-php/orm that referenced this issue Oct 2, 2019
lcobucci added a commit that referenced this issue Oct 2, 2019
#7841 SchemaTool generates extra diff for platforms without FK support
@lcobucci lcobucci assigned lcobucci and unassigned vpArth Oct 2, 2019
@lcobucci lcobucci added this to the 2.6.5 milestone Oct 2, 2019
@lcobucci
Copy link
Member

lcobucci commented Oct 2, 2019

Handled by #7842

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

No branches or pull requests

2 participants