8000 SchemaTool generates extra diff for platforms without FK support · Issue #7841 · doctrine/orm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
SchemaTool generates extra diff for platforms without FK support #7841
Closed
@vpArth

Description

@vpArth

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;

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0