diff --git a/lib/CF/Schema/Result/EventACL.pm b/lib/CF/Schema/Result/EventACL.pm index 8dc9dcff5549e65808b7e0316df2b66598328987..3702eb9f6bf15827f8e97e225fdd975f81b41cca 100644 --- a/lib/CF/Schema/Result/EventACL.pm +++ b/lib/CF/Schema/Result/EventACL.pm @@ -18,8 +18,7 @@ __PACKAGE__->add_columns( }, qw( event_id - subject_class - subject + subject_id role ), ); @@ -31,4 +30,11 @@ __PACKAGE__->belongs_to( }, ); +__PACKAGE__->belongs_to( + subject => 'CF::Schema::Result::EventACLSubject', + { + 'foreign.id' => 'self.subject_id', + }, +); + 1; diff --git a/lib/CF/Schema/Result/EventACLSubject.pm b/lib/CF/Schema/Result/EventACLSubject.pm new file mode 100644 index 0000000000000000000000000000000000000000..3b7f8cac7ed2ca562971a95a69a9790a77bda741 --- /dev/null +++ b/lib/CF/Schema/Result/EventACLSubject.pm @@ -0,0 +1,34 @@ +package CF::Schema::Result::EventACLSubject; + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +our $VERSION = 1; + +__PACKAGE__->table('events_acl_subjects'); + +__PACKAGE__->add_columns( + id => { + data_type => 'integer', + is_auto_increment => 1, + is_nullable => 0, + sequence => 'uid_seq' + }, + qw( + updated + class + key + name + ), +); + +__PACKAGE__->set_primary_key('id'); + +__PACKAGE__->add_unique_constraint( + class_key => [qw(class key)] +); + +1; +