package MyDictionary::En_To_Sk MyDictionary::En_To_Sk->columns(Primary => qw/id/); MyDictionary::En_To_Sk->columns(Essential => qw/eng_id sk_id/); # Declare the relationships MyDictionary::En_To_Sk->has_a('eng_id' => "MyDictionary::Engword"); MyDictionary::En_To_Sk->has_a('sk_id' => "MyDictionary::Skword"); package MyDictionary::Engword MyDictionary::Engword->columns(Primary => qw/id/); MyDictionary::Engword->has_many("translations", 'MyDictionary::En_To_Sk', 'eng_id'); package MyDictionary::Skword MyDictionary::Skword->columns(Primary => qw/id/); MyDictionary::Skword->has_many("translations", 'MyDictionary::En_To_Sk', 'sk_id');