0
# 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 }
如果我們改變
地方:CATEGORY_ID '到' foreign_key:CATEGORY_ID
和
國外:ID '到' 引用:編號
那麼它會更有意義或原始人呢?
我的意思是Symfony的創造者們真的很有經驗[Jonathan Wage和Fabien Potencier],所以他們必須遵循我不知道的一些數據庫設計。
只是好奇知道如果有人知道它爲什麼,這是在Symfony的方式?