Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 371ab59d

Von Bernd Bleßmann vor fast 5 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
# 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::ContactDepartment;
use strict;
use SL::DB::MetaSetup::ContactDepartment;
use SL::DB::Manager::ContactDepartment;
__PACKAGE__->meta->initialize;
1;
SL/DB/Helper/ALL.pm
use SL::DB::Business;
use SL::DB::Chart;
use SL::DB::Contact;
use SL::DB::ContactDepartment;
use SL::DB::ContactTitle;
use SL::DB::CsvImportProfile;
use SL::DB::CsvImportProfileSetting;
SL/DB/Helper/Mappings.pm
bin => 'bin',
business => 'business',
chart => 'chart',
contact_departments => 'contact_department',
contact_titles => 'contact_title',
contacts => 'contact',
customer => 'customer',
SL/DB/Manager/ContactDepartment.pm
# 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::ContactDepartment;
use strict;
use parent qw(SL::DB::Helper::Manager);
sub object_class { 'SL::DB::ContactDepartment' }
__PACKAGE__->make_manager_methods;
1;
SL/DB/MetaSetup/ContactDepartment.pm
# This file has been auto-generated. Do not modify it; it will be overwritten
# by rose_auto_create_model.pl automatically.
package SL::DB::ContactDepartment;
use strict;
use parent qw(SL::DB::Object);
__PACKAGE__->meta->table('contact_departments');
__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;
;
sql/Pg-upgrade2/contact_departments_own_table.sql
-- @tag: contact_departments_own_table
-- @description: Eigene Tabelle für Abteilungen bei Ansprechpersonen
-- @depends: release_3_5_5
CREATE TABLE contact_departments (
id SERIAL,
description TEXT NOT NULL,
PRIMARY KEY (id),
UNIQUE (description)
);
UPDATE contacts SET cp_abteilung = trim(cp_abteilung) WHERE cp_abteilung NOT LIKE trim(cp_abteilung);
INSERT INTO contact_departments (description)
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