From 26892ad4061a94cce873952f1e72d4f7badf6e3b Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 21 May 2013 13:00:02 +0200 Subject: [PATCH] =?utf8?q?Rose-Model=20f=C3=BCr=20neue=20Tabelle=20currenc?= =?utf8?q?ies?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/DB/Currency.pm | 13 +++++++++++++ SL/DB/Helper/ALL.pm | 1 + SL/DB/Helper/Mappings.pm | 1 + SL/DB/MetaSetup/Currency.pm | 23 +++++++++++++++++++++++ SL/DB/MetaSetup/Default.pm | 9 +++++++++ 5 files changed, 47 insertions(+) create mode 100644 SL/DB/Currency.pm create mode 100644 SL/DB/MetaSetup/Currency.pm diff --git a/SL/DB/Currency.pm b/SL/DB/Currency.pm new file mode 100644 index 000000000..14ba066e9 --- /dev/null +++ b/SL/DB/Currency.pm @@ -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; diff --git a/SL/DB/Helper/ALL.pm b/SL/DB/Helper/ALL.pm index bff5089b9..f951bf9d0 100644 --- a/SL/DB/Helper/ALL.pm +++ b/SL/DB/Helper/ALL.pm @@ -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; diff --git a/SL/DB/Helper/Mappings.pm b/SL/DB/Helper/Mappings.pm index cc4d2abe1..f0b8be9af 100644 --- a/SL/DB/Helper/Mappings.pm +++ b/SL/DB/Helper/Mappings.pm @@ -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 index 000000000..705467f03 --- /dev/null +++ b/SL/DB/MetaSetup/Currency.pm @@ -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; +; diff --git a/SL/DB/MetaSetup/Default.pm b/SL/DB/MetaSetup/Default.pm index aec99e26f..7b1df394f 100644 --- a/SL/DB/MetaSetup/Default.pm +++ b/SL/DB/MetaSetup/Default.pm @@ -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; -- 2.20.1