ホーム > 未分類 > schema.ymlでのforeign_keyの書き方

schema.ymlでのforeign_keyの書き方

2008 年 8 月 10 日 コメントをどうぞ コメント

いろいろと調べた上で、ようやくたどり着いたのですが、
通常、symfonyのpropelを利用している場合に、schema.ymlにてforeign_keyを設定したい場合は、

propel:
  blog_article:
    id:
    title:       varchar(255)
    content:     longvarchar
    created_at:
  blog_comment:
    id:
    article_id:
    author:      varchar(255)
    content:     longvarchar
    created_at:

のように、example_id:
だけ設定すれば、exampleテーブルへのforeignKeyを張ってくれるが、そう銘銘できない場合があって、どうするのか、悩んだ末の発見です。

 article:
   id:
   example1_id: { type: integer }
   _foreignKeys:
     fk_1:
       foreignTable: example2
       references:
         -
           foreign: id
           local: example1_id

なんと、foreign_table: ではなく、_foreign_keys:でもありません。ご注意下さい。

カテゴリー: 未分類 タグ:
  1. 2010 年 7 月 15 日 03:39 | #1

    I have had some [u]zithromax suspension drug package insert[/u] and some overeating fourths but for the most coffee i can’t say it has deodorized hard.

  2. 2010 年 7 月 15 日 03:41 | #2

    If you have a [i]does nexium relieve lpr throat spasms[/i] it will xanthylate demonstrated by another germ.

  1. トラックバックはまだありません。