Rose-Model für neue Tabelle currencies
authorMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 21 May 2013 11:00:02 +0000 (13:00 +0200)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 21 May 2013 11:00:02 +0000 (13:00 +0200)
SL/DB/Currency.pm [new file with mode: 0644]
SL/DB/Helper/ALL.pm
SL/DB/Helper/Mappings.pm
SL/DB/MetaSetup/Currency.pm [new file with mode: 0644]
SL/DB/MetaSetup/Default.pm

diff --git a/SL/DB/Currency.pm b/SL/DB/Currency.pm
new file mode 100644 (file)
index 0000000..14ba066
--- /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::Currency;
+
+use strict;
+
+use SL::DB::MetaSetup::Currency;
+
+# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
+__PACKAGE__->meta->make_manager_class;
+
+1;
index bff5089..f951bf9 100644 (file)
@@ -20,6 +20,7 @@ use SL::DB::Chart;
 use SL::DB::Contact;
 use SL::DB::CsvImportProfile;
 use SL::DB::CsvImportProfileSetting;
+use SL::DB::Currency;
 use SL::DB::CustomVariable;
 use SL::DB::CustomVariableConfig;
 use SL::DB::CustomVariableValidity;
index cc4d2ab..f0b8be9 100644 (file)
@@ -55,6 +55,7 @@ my %lxoffice_package_names = (
   csv_import_reports             => 'csv_import_report',
   csv_import_report_rows         => 'csv_import_report_row',
   csv_import_report_status       => 'csv_import_report_status',
+  currencies                     => 'currency',
   custom_variable_configs        => 'custom_variable_config',
   custom_variables               => 'custom_variable',
   custom_variables_validity      => 'custom_variable_validity',
diff --git a/SL/DB/MetaSetup/Currency.pm b/SL/DB/MetaSetup/Currency.pm
new file mode 100644 (file)
index 0000000..705467f
--- /dev/null
@@ -0,0 +1,23 @@
+# This file has been auto-generated. Do not modify it; it will be overwritten
+# by rose_auto_create_model.pl automatically.
+package SL::DB::Currency;
+
+use strict;
+
+use base qw(SL::DB::Object);
+
+__PACKAGE__->meta->setup(
+  table   => 'currencies',
+
+  columns => [
+    id   => { type => 'serial', not_null => 1 },
+    name => { type => 'text', not_null => 1 },
+  ],
+
+  primary_key_columns => [ 'id' ],
+
+  unique_key => [ 'name' ],
+);
+
+1;
+;
index aec99e2..7b1df39 100644 (file)
@@ -71,6 +71,15 @@ __PACKAGE__->meta->setup(
   ],
 
   primary_key_columns => [ 'id' ],
+
+  allow_inline_column_values => 1,
+
+  foreign_keys => [
+    currency => {
+      class       => 'SL::DB::Currency',
+      key_columns => { currency_id => 'id' },
+    },
+  ],
 );
 
 1;