Model SL::DB::Prices in SL::DB::Price umbenannt
authorMoritz Bunkus <m.bunkus@linet-services.de>
Thu, 3 Mar 2011 09:46:25 +0000 (10:46 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Thu, 3 Mar 2011 09:46:25 +0000 (10:46 +0100)
Conflicts:

SL/DB/Helper/Mappings.pm
SL/DB/Part.pm

SL/DB/Helper/ALL.pm
SL/DB/Helper/Mappings.pm
SL/DB/MetaSetup/Price.pm [new file with mode: 0644]
SL/DB/MetaSetup/Prices.pm [deleted file]
SL/DB/Part.pm
SL/DB/Price.pm [new file with mode: 0644]
SL/DB/Prices.pm [deleted file]

index f5973b3..c030bed 100644 (file)
@@ -56,7 +56,7 @@ use SL::DB::PeriodicInvoice;
 use SL::DB::PeriodicInvoicesConfig;
 use SL::DB::PriceFactor;
 use SL::DB::Pricegroup;
-use SL::DB::Prices;
+use SL::DB::Price;
 use SL::DB::Printer;
 use SL::DB::Project;
 use SL::DB::PurchaseInvoice;
index 4771904..7f7c475 100644 (file)
@@ -77,7 +77,7 @@ my %lxoffice_package_names = (
   payment_terms                  => 'payment_term',
   periodic_invoices              => 'periodic_invoice',
   periodic_invoices_configs      => 'periodic_invoices_config',
-  prices                         => 'prices',
+  prices                         => 'price',
   price_factors                  => 'price_factor',
   pricegroup                     => 'pricegroup',
   printers                       => 'Printer',
diff --git a/SL/DB/MetaSetup/Price.pm b/SL/DB/MetaSetup/Price.pm
new file mode 100644 (file)
index 0000000..bb6f0fd
--- /dev/null
@@ -0,0 +1,35 @@
+# This file has been auto-generated. Do not modify it; it will be overwritten
+# by rose_auto_create_model.pl automatically.
+package SL::DB::Price;
+
+use strict;
+
+use base qw(SL::DB::Object);
+
+__PACKAGE__->meta->setup(
+  table   => 'prices',
+
+  columns => [
+    parts_id      => { type => 'integer' },
+    pricegroup_id => { type => 'integer' },
+    price         => { type => 'numeric', precision => 5, scale => 15 },
+    id            => { type => 'serial', not_null => 1 },
+  ],
+
+  primary_key_columns => [ 'id' ],
+
+  foreign_keys => [
+    parts => {
+      class       => 'SL::DB::Part',
+      key_columns => { parts_id => 'id' },
+    },
+
+    pricegroup => {
+      class       => 'SL::DB::Pricegroup',
+      key_columns => { pricegroup_id => 'id' },
+    },
+  ],
+);
+
+1;
+;
diff --git a/SL/DB/MetaSetup/Prices.pm b/SL/DB/MetaSetup/Prices.pm
deleted file mode 100644 (file)
index 819d14c..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-# This file has been auto-generated. Do not modify it; it will be overwritten
-# by rose_auto_create_model.pl automatically.
-package SL::DB::Prices;
-
-use strict;
-
-use base qw(SL::DB::Object);
-
-__PACKAGE__->meta->setup(
-  table   => 'prices',
-
-  columns => [
-    parts_id      => { type => 'integer' },
-    pricegroup_id => { type => 'integer' },
-    price         => { type => 'numeric', precision => 5, scale => 15 },
-    id            => { type => 'serial', not_null => 1 },
-  ],
-
-  primary_key_columns => [ 'id' ],
-
-  foreign_keys => [
-    parts => {
-      class       => 'SL::DB::Part',
-      key_columns => { parts_id => 'id' },
-    },
-
-    pricegroup => {
-      class       => 'SL::DB::Pricegroup',
-      key_columns => { pricegroup_id => 'id' },
-    },
-  ],
-);
-
-1;
-;
index 8ec7b3b..fd55e02 100644 (file)
@@ -31,6 +31,11 @@ __PACKAGE__->meta->add_relationships(
     class        => 'SL::DB::PriceFactor',
     column_map   => { price_factor_id => 'id' },
   },
+  prices         => {
+    type         => 'one to many',
+    class        => 'SL::DB::Price',
+    column_map   => { id => 'parts_id' },
+  },
 );
 
 __PACKAGE__->meta->initialize;
diff --git a/SL/DB/Price.pm b/SL/DB/Price.pm
new file mode 100644 (file)
index 0000000..9029dff
--- /dev/null
@@ -0,0 +1,13 @@
+# This file has been auto-generated only because it didn't exist.
+# Feel free to modify it at will; it will not be overwritten automatically.
+
+package SL::DB::Price;
+
+use strict;
+
+use SL::DB::MetaSetup::Price;
+
+# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
+__PACKAGE__->meta->make_manager_class;
+
+1;
diff --git a/SL/DB/Prices.pm b/SL/DB/Prices.pm
deleted file mode 100644 (file)
index 45d54a0..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-# This file has been auto-generated only because it didn't exist.
-# Feel free to modify it at will; it will not be overwritten automatically.
-
-package SL::DB::Prices;
-
-use strict;
-
-use SL::DB::MetaSetup::Prices;
-
-# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
-__PACKAGE__->meta->make_manager_class;
-
-1;