schema.yml (Symfony 1.4) の私の Post モデルは次のようになります。
Post:
columns:
id: { type: bigint, notnull: true, primary: true }
blog_id: { type: bigint, notnull: true, primary: true }
user_id: { type: bigint, notnull: true }
subject: { type: string(255), notnull: true }
short_body: { type: text, notnull: true }
long_body: { type: text }
ご覧のとおり、Post には複数列の PK があります。私の質問は、「このモデルと n:1 の関係を作成するにはどうすればよいですか?」です。
例として、次のようなものが必要です。
PostComment:
columns:
post_id: { type: bigint, notnull: true }
blog_id: { type: bigint, notnull: true }
name: { type: string(255), notnull: true }
email: { type: string(255) }
text: { type: text, notnull: true }
relations:
Post:
#Here is my problem. What should I write here?
local: ????
foreign: ????
foreignAlias: Comments
onDelete: cascade
onUpdate: cascade
このタイプの関係をどのように処理できますか?