Optimized database table schema

This commit is contained in:
Kevin Frantz 2018-10-28 15:41:43 +01:00
parent 25020bbe97
commit 8cf73a2b47
6 changed files with 9 additions and 7 deletions

View File

@ -9,7 +9,7 @@ use App\Entity\Attribut\RelationAttribut;
/** /**
* *
* @author kevinfrantz * @author kevinfrantz
* @ORM\Table(name="law") * @ORM\Table(name="meta_law")
* @ORM\Entity(repositoryClass="App\Repository\LawRepository") * @ORM\Entity(repositoryClass="App\Repository\LawRepository")
*/ */
class Law extends AbstractMeta implements LawInterface class Law extends AbstractMeta implements LawInterface

View File

@ -13,7 +13,7 @@ use App\Entity\Attribut\RelationAttributInterface;
/** /**
* @author kevinfrantz * @author kevinfrantz
* @ORM\Table(name="reciever_group") * @ORM\Table(name="meta_reciever_group")
* @ORM\Entity() * @ORM\Entity()
*/ */
class RecieverGroup extends AbstractMeta implements RecieverGroupInterface class RecieverGroup extends AbstractMeta implements RecieverGroupInterface

View File

@ -18,7 +18,7 @@ use Doctrine\Common\Collections\Collection;
* Also it is used to capsel the logic relation to an own logical unit. * Also it is used to capsel the logic relation to an own logical unit.
* @author kevinfrantz * @author kevinfrantz
* @todo rename and refactor this class * @todo rename and refactor this class
* @ORM\Table(name="node") * @ORM\Table(name="meta_relation")
* @ORM\Entity() * @ORM\Entity()
*/ */
class Relation extends AbstractMeta implements RelationInterface class Relation extends AbstractMeta implements RelationInterface
@ -32,7 +32,7 @@ class Relation extends AbstractMeta implements RelationInterface
/** /**
* Parents represent the creators of the relation * Parents represent the creators of the relation
* @ORM\ManyToMany(targetEntity="Relation") * @ORM\ManyToMany(targetEntity="Relation")
* @ORM\JoinTable(name="relation_parents", * @ORM\JoinTable(name="meta_relation_parents",
* joinColumns={@ORM\JoinColumn(name="relation_id", referencedColumnName="id")}, * joinColumns={@ORM\JoinColumn(name="relation_id", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="relation_id", referencedColumnName="id")} * inverseJoinColumns={@ORM\JoinColumn(name="relation_id", referencedColumnName="id")}
* ) * )
@ -46,7 +46,7 @@ class Relation extends AbstractMeta implements RelationInterface
* @todo Replace this by self referencing * @todo Replace this by self referencing
* @see https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/reference/association-mapping.html * @see https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/reference/association-mapping.html
* @ORM\ManyToMany(targetEntity="Relation") * @ORM\ManyToMany(targetEntity="Relation")
* @ORM\JoinTable(name="relation_childs", * @ORM\JoinTable(name="meta_relation_childs",
* joinColumns={@ORM\JoinColumn(name="relation_id", referencedColumnName="id")}, * joinColumns={@ORM\JoinColumn(name="relation_id", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="relation_id", referencedColumnName="id")} * inverseJoinColumns={@ORM\JoinColumn(name="relation_id", referencedColumnName="id")}
* ) * )

View File

@ -17,7 +17,7 @@ use App\Entity\Attribut\RelationAttribut;
/** /**
* @author kevinfrantz * @author kevinfrantz
* @ORM\Table(name="`right`") * @ORM\Table(name="meta_right")
* @ORM\Entity(repositoryClass="App\Repository\RightRepository") * @ORM\Entity(repositoryClass="App\Repository\RightRepository")
*/ */
class Right extends AbstractMeta implements RightInterface class Right extends AbstractMeta implements RightInterface

View File

@ -34,6 +34,8 @@ abstract class AbstractSource extends AbstractEntity implements SourceInterface
protected $relation; protected $relation;
/** /**
* @todo Implement that just one table on database level is needed!
* @todo Rename table to use the right schema
* @var Collection|GroupSource[] * @var Collection|GroupSource[]
* @ORM\ManyToMany(targetEntity="GroupSource") * @ORM\ManyToMany(targetEntity="GroupSource")
*/ */

View File

@ -9,7 +9,7 @@ use App\Entity\Source\Attribut\MembersAttribut;
/** /**
* *
* @author kevinfrantz * @author kevinfrantz
* @ORM\Table(name="source_sources") * @ORM\Table(name="source_group")
* @ORM\Entity * @ORM\Entity
*/ */
class GroupSource extends AbstractSource implements MembersAttributInterface class GroupSource extends AbstractSource implements MembersAttributInterface