Schemaクラス - DBIx::Class

前提

テーブルt1

  • id int (PK)
  • t2_id int (FK)

テーブルt2

  • id int (PK)

主キーの設定

 __PACKAGE__->set_primary_key('id');

外部キーの設定

 __PACKAGE__->has_many("t2" => "DB::T2", {"foreign.id" => "self.t2_id"});

トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS