FollowUp(Access)-Rose-Models: sinnvollere Namen für Relationships
authorMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 25 Jun 2014 09:50:22 +0000 (11:50 +0200)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 25 Jun 2014 09:50:22 +0000 (11:50 +0200)
SL/DB/MetaSetup/FollowUp.pm
SL/DB/MetaSetup/FollowUpAccess.pm
scripts/rose_auto_create_model.pl

index bda14ec..a6702b6 100644 (file)
@@ -24,14 +24,14 @@ __PACKAGE__->meta->primary_key_columns([ 'id' ]);
 __PACKAGE__->meta->allow_inline_column_values(1);
 
 __PACKAGE__->meta->foreign_keys(
-  created_for => {
+  created_by => {
     class       => 'SL::DB::Employee',
-    key_columns => { created_for_user => 'id' },
+    key_columns => { created_by => 'id' },
   },
 
-  employee => {
+  created_for => {
     class       => 'SL::DB::Employee',
-    key_columns => { created_by => 'id' },
+    key_columns => { created_for_user => 'id' },
   },
 
   note => {
index 43d5386..c2fccb1 100644 (file)
@@ -17,12 +17,12 @@ __PACKAGE__->meta->columns(
 __PACKAGE__->meta->primary_key_columns([ 'id' ]);
 
 __PACKAGE__->meta->foreign_keys(
-  employee => {
+  to_follow_ups_by => {
     class       => 'SL::DB::Employee',
     key_columns => { what => 'id' },
   },
 
-  employee_obj => {
+  with_access => {
     class       => 'SL::DB::Employee',
     key_columns => { who => 'id' },
   },
index 4f3360b..8106576 100755 (executable)
@@ -69,7 +69,8 @@ our %foreign_key_name_map     = (
     orderitems                => { parts_id => 'part', trans_id => 'order', },
     delivery_order_items      => { parts_id => 'part' },
     invoice                   => { parts_id => 'part' },
-    follow_ups                => { created_for_user => 'created_for', created_by => 'employee', },
+    follow_ups                => { created_for_user => 'created_for', created_by => 'created_by', },
+    follow_up_access          => { who => 'with_access', what => 'to_follow_ups_by', },
 
     periodic_invoices_configs => { oe_id => 'order' },
   },