Symfony / Doktrini şema

0 Cevap
# config/doctrine/schema.yml
Category:
  actAs: { Timestampable: ~ }
  columns:
    name: { type: string(255), notnull: true, unique: true }

Project:
  actAs: { Timestampable: ~ }
  columns:
    category_id:  { type: integer, notnull: true }
    title:         { type: string(255) }
    description:  { type: string(4000), notnull: true }
  relations:
    Category: { onDelete: CASCADE, local: category_id, foreign: id, foreignAlias: Projects }

Burada,

Biz değiştirirseniz

category_id: Yerel: foreign_key 'için' category_id

ve

yabancı: referanslar için 'id: id

Sonra daha mantıklı ya da Orijinal Bir yok olacak?

I'm mean creators of Symfony are really experienced [Jonathan Wage veFabien Potencier] so they must be following some DB Design that I maynot know .

O, o Symfony'de olduğu Way neden birisi bilen varsa sadece merak bilmek?

0 Cevap