Revision 041274ee
Von Bernd Bleßmann vor mehr als 4 Jahren hinzugefügt
SL/DB/Greeting.pm | ||
---|---|---|
1 |
# This file has been auto-generated only because it didn't exist. |
|
2 |
# Feel free to modify it at will; it will not be overwritten automatically. |
|
3 |
|
|
4 |
package SL::DB::Greeting; |
|
5 |
|
|
6 |
use strict; |
|
7 |
|
|
8 |
use SL::DB::MetaSetup::Greeting; |
|
9 |
use SL::DB::Manager::Greeting; |
|
10 |
|
|
11 |
__PACKAGE__->meta->initialize; |
|
12 |
|
|
13 |
1; |
SL/DB/Helper/ALL.pm | ||
---|---|---|
62 | 62 |
use SL::DB::FollowUpLink; |
63 | 63 |
use SL::DB::GLTransaction; |
64 | 64 |
use SL::DB::GenericTranslation; |
65 |
use SL::DB::Greeting; |
|
65 | 66 |
use SL::DB::History; |
66 | 67 |
use SL::DB::Inventory; |
67 | 68 |
use SL::DB::Invoice; |
SL/DB/Helper/Mappings.pm | ||
---|---|---|
146 | 146 |
follow_ups => 'follow_up', |
147 | 147 |
generic_translations => 'generic_translation', |
148 | 148 |
gl => 'GLTransaction', |
149 |
greetings => 'greeting', |
|
149 | 150 |
history_erp => 'history', |
150 | 151 |
inventory => 'inventory', |
151 | 152 |
invoice => 'invoice_item', |
SL/DB/Manager/Greeting.pm | ||
---|---|---|
1 |
# This file has been auto-generated only because it didn't exist. |
|
2 |
# Feel free to modify it at will; it will not be overwritten automatically. |
|
3 |
|
|
4 |
package SL::DB::Manager::Greeting; |
|
5 |
|
|
6 |
use strict; |
|
7 |
|
|
8 |
use parent qw(SL::DB::Helper::Manager); |
|
9 |
|
|
10 |
sub object_class { 'SL::DB::Greeting' } |
|
11 |
|
|
12 |
__PACKAGE__->make_manager_methods; |
|
13 |
|
|
14 |
1; |
SL/DB/MetaSetup/Greeting.pm | ||
---|---|---|
1 |
# This file has been auto-generated. Do not modify it; it will be overwritten |
|
2 |
# by rose_auto_create_model.pl automatically. |
|
3 |
package SL::DB::Greeting; |
|
4 |
|
|
5 |
use strict; |
|
6 |
|
|
7 |
use parent qw(SL::DB::Object); |
|
8 |
|
|
9 |
__PACKAGE__->meta->table('greetings'); |
|
10 |
|
|
11 |
__PACKAGE__->meta->columns( |
|
12 |
description => { type => 'text', not_null => 1 }, |
|
13 |
id => { type => 'serial', not_null => 1 }, |
|
14 |
); |
|
15 |
|
|
16 |
__PACKAGE__->meta->primary_key_columns([ 'id' ]); |
|
17 |
|
|
18 |
__PACKAGE__->meta->unique_keys([ 'description' ]); |
|
19 |
|
|
20 |
1; |
|
21 |
; |
sql/Pg-upgrade2/greetings_own_table.sql | ||
---|---|---|
1 |
-- @tag: greetings_own_table |
|
2 |
-- @description: Eigene Tabelle für Anreden |
|
3 |
-- @depends: release_3_5_5 |
|
4 |
|
|
5 |
CREATE TABLE greetings ( |
|
6 |
id SERIAL, |
|
7 |
description TEXT NOT NULL, |
|
8 |
PRIMARY KEY (id), |
|
9 |
UNIQUE (description) |
|
10 |
); |
|
11 |
|
|
12 |
UPDATE customer SET greeting = trim(greeting) WHERE greeting NOT LIKE trim(greeting); |
|
13 |
UPDATE vendor SET greeting = trim(greeting) WHERE greeting NOT LIKE trim(greeting); |
|
14 |
|
|
15 |
INSERT INTO greetings (description) |
|
16 |
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; |
Auch abrufbar als: Unified diff
Anreden in eigene Tabelle: DB-Upgrade und Rose