Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 371ab59d

Von Bernd Bleßmann vor mehr als 4 Jahren hinzugefügt

  • ID 371ab59da0ebb21a8438cab732530e1cf5f9471c
  • Vorgänger 1dd6d84a
  • Nachfolger 30d53fc8

Abteilungen bei Ansprechpersonen in eigene Tabelle: DB-Upgrade und Rose

Unterschiede anzeigen:

SL/DB/ContactDepartment.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::ContactDepartment;
5

  
6
use strict;
7

  
8
use SL::DB::MetaSetup::ContactDepartment;
9
use SL::DB::Manager::ContactDepartment;
10

  
11
__PACKAGE__->meta->initialize;
12

  
13
1;
SL/DB/Helper/ALL.pm
27 27
use SL::DB::Business;
28 28
use SL::DB::Chart;
29 29
use SL::DB::Contact;
30
use SL::DB::ContactDepartment;
30 31
use SL::DB::ContactTitle;
31 32
use SL::DB::CsvImportProfile;
32 33
use SL::DB::CsvImportProfileSetting;
SL/DB/Helper/Mappings.pm
110 110
  bin                            => 'bin',
111 111
  business                       => 'business',
112 112
  chart                          => 'chart',
113
  contact_departments            => 'contact_department',
113 114
  contact_titles                 => 'contact_title',
114 115
  contacts                       => 'contact',
115 116
  customer                       => 'customer',
SL/DB/Manager/ContactDepartment.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::ContactDepartment;
5

  
6
use strict;
7

  
8
use parent qw(SL::DB::Helper::Manager);
9

  
10
sub object_class { 'SL::DB::ContactDepartment' }
11

  
12
__PACKAGE__->make_manager_methods;
13

  
14
1;
SL/DB/MetaSetup/ContactDepartment.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::ContactDepartment;
4

  
5
use strict;
6

  
7
use parent qw(SL::DB::Object);
8

  
9
__PACKAGE__->meta->table('contact_departments');
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/contact_departments_own_table.sql
1
-- @tag: contact_departments_own_table
2
-- @description: Eigene Tabelle für Abteilungen bei Ansprechpersonen
3
-- @depends: release_3_5_5
4

  
5
CREATE TABLE contact_departments (
6
  id          SERIAL,
7
  description TEXT    NOT NULL,
8
  PRIMARY KEY (id),
9
  UNIQUE (description)
10
);
11

  
12
UPDATE contacts SET cp_abteilung = trim(cp_abteilung) WHERE cp_abteilung NOT LIKE trim(cp_abteilung);
13

  
14
INSERT INTO contact_departments (description)
15
  SELECT DISTINCT cp_abteilung FROM contacts WHERE cp_abteilung IS NOT NULL AND cp_abteilung NOT LIKE '' ORDER BY cp_abteilung;

Auch abrufbar als: Unified diff