diff --git a/lib/NGCP/Schema/Result/contracts.pm b/lib/NGCP/Schema/Result/contracts.pm index 29903180..f3832efe 100644 --- a/lib/NGCP/Schema/Result/contracts.pm +++ b/lib/NGCP/Schema/Result/contracts.pm @@ -80,6 +80,18 @@ __PACKAGE__->add_columns( extra => { unsigned => 1 }, is_nullable => 1, }, + "subscriber_email_template_id", + { + data_type => "integer", + extra => { unsigned => 1 }, + is_nullable => 1, + }, + "passreset_email_template_id", + { + data_type => "integer", + extra => { unsigned => 1 }, + is_nullable => 1, + }, ); __PACKAGE__->set_primary_key("id"); @@ -169,6 +181,20 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +__PACKAGE__->belongs_to( + "subscriber_email_template", + "NGCP::Schema::Result::email_tempaltes", + { "foreign.id" => "self.subscriber_email_template_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +__PACKAGE__->belongs_to( + "passreset_email_template", + "NGCP::Schema::Result::email_tempaltes", + { "foreign.id" => "self.subscriber_email_template_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + sub TO_JSON { my ($self) = @_; return {