--- /dev/null
+# 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::Greeting;
+
+use strict;
+
+use SL::DB::MetaSetup::Greeting;
+use SL::DB::Manager::Greeting;
+
+__PACKAGE__->meta->initialize;
+
+1;
use SL::DB::FollowUpLink;
use SL::DB::GLTransaction;
use SL::DB::GenericTranslation;
+use SL::DB::Greeting;
use SL::DB::History;
use SL::DB::Inventory;
use SL::DB::Invoice;
follow_ups => 'follow_up',
generic_translations => 'generic_translation',
gl => 'GLTransaction',
+ greetings => 'greeting',
history_erp => 'history',
inventory => 'inventory',
invoice => 'invoice_item',
--- /dev/null
+# 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::Manager::Greeting;
+
+use strict;
+
+use parent qw(SL::DB::Helper::Manager);
+
+sub object_class { 'SL::DB::Greeting' }
+
+__PACKAGE__->make_manager_methods;
+
+1;
--- /dev/null
+# This file has been auto-generated. Do not modify it; it will be overwritten
+# by rose_auto_create_model.pl automatically.
+package SL::DB::Greeting;
+
+use strict;
+
+use parent qw(SL::DB::Object);
+
+__PACKAGE__->meta->table('greetings');
+
+__PACKAGE__->meta->columns(
+ description => { type => 'text', not_null => 1 },
+ id => { type => 'serial', not_null => 1 },
+);
+
+__PACKAGE__->meta->primary_key_columns([ 'id' ]);
+
+__PACKAGE__->meta->unique_keys([ 'description' ]);
+
+1;
+;
--- /dev/null
+-- @tag: greetings_own_table
+-- @description: Eigene Tabelle für Anreden
+-- @depends: release_3_5_5
+
+CREATE TABLE greetings (
+ id SERIAL,
+ description TEXT NOT NULL,
+ PRIMARY KEY (id),
+ UNIQUE (description)
+);
+
+UPDATE customer SET greeting = trim(greeting) WHERE greeting NOT LIKE trim(greeting);
+UPDATE vendor SET greeting = trim(greeting) WHERE greeting NOT LIKE trim(greeting);
+
+INSERT INTO greetings (description)
+ SELECT DISTINCT greeting FROM (SELECT greeting FROM customer UNION SELECT greeting FROM vendor) AS gr WHERE greeting IS NOT NULL AND greeting NOT LIKE '' ORDER BY greeting;