From: Moritz Bunkus Date: Fri, 8 Mar 2013 13:16:52 +0000 (+0100) Subject: Update Pflichtenheftmodels auf DB-Struktur X-Git-Tag: release-3.2.0beta~467^2~234 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=3250f2ee17441742890fe97b4fe5851626029441;p=kivitendo-erp.git Update Pflichtenheftmodels auf DB-Struktur --- diff --git a/SL/DB/MetaSetup/RequirementSpecDependency.pm b/SL/DB/MetaSetup/RequirementSpecDependency.pm index 29f0654df..4f9eae569 100644 --- a/SL/DB/MetaSetup/RequirementSpecDependency.pm +++ b/SL/DB/MetaSetup/RequirementSpecDependency.pm @@ -15,6 +15,18 @@ __PACKAGE__->meta->setup( ], primary_key_columns => [ 'depending_item_id', 'depended_item_id' ], + + foreign_keys => [ + depended_item => { + class => 'SL::DB::RequirementSpecItem', + key_columns => { depended_item_id => 'id' }, + }, + + depending_item => { + class => 'SL::DB::RequirementSpecItem', + key_columns => { depending_item_id => 'id' }, + }, + ], ); 1; diff --git a/SL/DB/MetaSetup/RequirementSpecItem.pm b/SL/DB/MetaSetup/RequirementSpecItem.pm index 85cfc362a..cb92d3831 100644 --- a/SL/DB/MetaSetup/RequirementSpecItem.pm +++ b/SL/DB/MetaSetup/RequirementSpecItem.pm @@ -47,21 +47,15 @@ __PACKAGE__->meta->setup( class => 'SL::DB::RequirementSpecItem', key_columns => { parent_id => 'id' }, }, - ], - relationships => [ - depended_items => { - map_class => 'SL::DB::RequirementSpecDependency', - map_from => 'depending_item', - map_to => 'depended_item', - type => 'many to many', + requirement_spec => { + class => 'SL::DB::RequirementSpec', + key_columns => { requirement_spec_id => 'id' }, }, - depending_items => { - map_class => 'SL::DB::RequirementSpecDependency', - map_from => 'depended_item', - map_to => 'depending_item', - type => 'many to many', + risk => { + class => 'SL::DB::RequirementSpecRisk', + key_columns => { risk_id => 'id' }, }, ], ); diff --git a/SL/DB/RequirementSpecItem.pm b/SL/DB/RequirementSpecItem.pm index 072b59b09..f7444daba 100644 --- a/SL/DB/RequirementSpecItem.pm +++ b/SL/DB/RequirementSpecItem.pm @@ -7,10 +7,22 @@ use SL::DB::Manager::RequirementSpecItem; use SL::DB::Helper::ActsAsList; __PACKAGE__->meta->add_relationship( - children => { - type => 'one to many', - class => 'SL::DB::RequirementSpecItem', - column_map => { id => 'parent_id' }, + children => { + type => 'one to many', + class => 'SL::DB::RequirementSpecItem', + column_map => { id => 'parent_id' }, + }, + dependencies => { + map_class => 'SL::DB::RequirementSpecDependency', + map_from => 'depending_item', + map_to => 'depended_item', + type => 'many to many', + }, + dependents => { + map_class => 'SL::DB::RequirementSpecDependency', + map_from => 'depended_item', + map_to => 'depending_item', + type => 'many to many', }, );