package MyApp::Schema::Result::Comment; use base qw/DBIx::Class::Core/; __PACKAGE__->table('comment'); __PACKAGE__->add_columns( id => {data_type => 'integer',is_auto_increment => 1,}, # e.g. comment for Play, or Concert, example value: "play" context => {data_type => 'text'}, ); __PACKAGE__->belongs_to ( # XXX can be Play or Concert or ... parent => 'MyApp::Schema::Result::XXX', 'YYY' # FK_id? for ids of Play or Concert or ...? ); #### package MyApp::Schema::Result::Play; use base qw/DBIx::Class::Core/; __PACKAGE__->table('play'); __PACKAGE__->add_columns( id => {data_type => 'integer',is_auto_increment => 1,}, context => {data_type => 'text'}, ); __PACKAGE__->has_many( comments => 'MyApp::Schema::Result::Comment', 'XXX' # what can go here? shall I add a FK_id in "comment"? );