commit 5991c23e862cb7be141c8aab0b2e645fea32fca1
Author: Sven Schöling <s.schoeling@googlemail.com>
Date:   Mon Sep 20 15:44:26 2010 +0200

    Leads aus den ROSE Models entfernt (kommt aus der CRM, wird nicht von der ERP verwaltet)

diff --git a/SL/DB/Helpers/ALL.pm b/SL/DB/Helpers/ALL.pm
index 4a258efbe..16184c5a1 100644
--- a/SL/DB/Helpers/ALL.pm
+++ b/SL/DB/Helpers/ALL.pm
@@ -41,7 +41,6 @@ use SL::DB::Inventory;
 use SL::DB::Invoice;
 use SL::DB::InvoiceItem;
 use SL::DB::Language;
-use SL::DB::Lead;
 use SL::DB::License;
 use SL::DB::LicenseInvoice;
 use SL::DB::MakeModel;
diff --git a/SL/DB/Helpers/Mappings.pm b/SL/DB/Helpers/Mappings.pm
index 7b0c959dd..fe7dc86b9 100644
--- a/SL/DB/Helpers/Mappings.pm
+++ b/SL/DB/Helpers/Mappings.pm
@@ -2,9 +2,10 @@ package SL::DB::Helpers::Mappings;
 
 use strict;
 
-# these will not be managed as Rose::DB models, because they are not normalized
-# significant changes are needed to get them done.
+# these will not be managed as Rose::DB models, because they are not normalized,
+# significant changes are needed to get them done, or they were done by CRM.
 my @lxoffice_blacklist_permanent = qw(
+  leads
 );
 
 # these are not managed _yet_, but will hopefully at some point.
@@ -51,7 +52,6 @@ my %lxoffice_package_names = (
   inventory                      => 'inventory',
   invoice                        => 'invoice_item',
   language                       => 'language',
-  leads                          => 'lead',
   license                        => 'license',
   licenseinvoice                 => 'license_invoice',
   makemodel                      => 'make_model',
diff --git a/SL/DB/Lead.pm b/SL/DB/Lead.pm
deleted file mode 100644
index 0c12c5c3b..000000000
--- a/SL/DB/Lead.pm
+++ /dev/null
@@ -1,13 +0,0 @@
-# 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::Lead;
-
-use strict;
-
-use SL::DB::MetaSetup::Lead;
-
-# 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/MetaSetup/Lead.pm b/SL/DB/MetaSetup/Lead.pm
deleted file mode 100644
index e12069aac..000000000
--- a/SL/DB/MetaSetup/Lead.pm
+++ /dev/null
@@ -1,21 +0,0 @@
-# This file has been auto-generated. Do not modify it; it will be overwritten
-# by rose_auto_create_model.pl automatically.
-package SL::DB::Lead;
-
-use strict;
-
-use base qw(SL::DB::Object);
-
-__PACKAGE__->meta->setup(
-  table   => 'leads',
-
-  columns => [
-    id   => { type => 'integer', not_null => 1, sequence => 'id' },
-    lead => { type => 'varchar', length => 50 },
-  ],
-
-  primary_key_columns => [ 'id' ],
-);
-
-1;
-;
diff --git a/sql/Pg-upgrade2/schema_nomalization_2.sql b/sql/Pg-upgrade2/schema_nomalization_2.sql
deleted file mode 100644
index 61143bb41..000000000
--- a/sql/Pg-upgrade2/schema_nomalization_2.sql
+++ /dev/null
@@ -1,30 +0,0 @@
--- @tag: schema_normalization_2
--- @description: Datenbankschema Normalisierungen Teil 2
--- @depends: schema_normalization_1
-
-ALTER TABLE acc_trans ADD COLUMN id SERIAL PRIMARY KEY;
-ALTER TABLE audittrail ADD COLUMN id SERIAL PRIMARY KEY;
-ALTER TABLE customertax ADD COLUMN id SERIAL PRIMARY KEY;
-ALTER TABLE datev ADD COLUMN id SERIAL PRIMARY KEY;
-ALTER TABLE defaults ADD COLUMN id SERIAL PRIMARY KEY;
-ALTER TABLE department ADD PRIMARY KEY (id);
-ALTER TABLE dpt_trans ADD COLUMN id SERIAL PRIMARY KEY;
-ALTER TABLE exchangerate ADD COLUMN id SERIAL PRIMARY KEY;
-ALTER TABLE finanzamt ADD COLUMN id SERIAL PRIMARY KEY;
-ALTER TABLE follow_up_access ADD COLUMN id SERIAL PRIMARY KEY;
-ALTER TABLE gifi ADD COLUMN id SERIAL PRIMARY KEY;
-ALTER TABLE inventory ADD COLUMN id SERIAL PRIMARY KEY;
-ALTER TABLE licenseinvoice ADD COLUMN id SERIAL PRIMARY KEY;
-ALTER TABLE leads ADD PRIMARY KEY (id);
-ALTER TABLE partsgroup ADD PRIMARY KEY (id);
-ALTER TABLE partstax ADD COLUMN id SERIAL PRIMARY KEY;
-ALTER TABLE prices ADD COLUMN id SERIAL PRIMARY KEY;
-ALTER TABLE record_links ADD COLUMN id SERIAL PRIMARY KEY;
-ALTER TABLE rmaitems ADD PRIMARY KEY (id);
-ALTER TABLE status ADD COLUMN id SERIAL PRIMARY KEY;
-ALTER TABLE tax_zones ADD PRIMARY KEY (id);
-ALTER TABLE todo_user_config ADD COLUMN id SERIAL PRIMARY KEY;
-ALTER TABLE translation ADD COLUMN id SERIAL PRIMARY KEY;
-ALTER TABLE translation_payment_terms ADD COLUMN id SERIAL PRIMARY KEY;
-ALTER TABLE units_language ADD COLUMN id SERIAL PRIMARY KEY;
-ALTER TABLE vendortax ADD COLUMN id SERIAL PRIMARY KEY;
diff --git a/sql/Pg-upgrade2/schema_normalization_2.sql b/sql/Pg-upgrade2/schema_normalization_2.sql
new file mode 100644
index 000000000..87ab63692
--- /dev/null
+++ b/sql/Pg-upgrade2/schema_normalization_2.sql
@@ -0,0 +1,29 @@
+-- @tag: schema_normalization_2
+-- @description: Datenbankschema Normalisierungen Teil 2
+-- @depends: schema_normalization_1
+
+ALTER TABLE acc_trans ADD COLUMN id SERIAL PRIMARY KEY;
+ALTER TABLE audittrail ADD COLUMN id SERIAL PRIMARY KEY;
+ALTER TABLE customertax ADD COLUMN id SERIAL PRIMARY KEY;
+ALTER TABLE datev ADD COLUMN id SERIAL PRIMARY KEY;
+ALTER TABLE defaults ADD COLUMN id SERIAL PRIMARY KEY;
+ALTER TABLE department ADD PRIMARY KEY (id);
+ALTER TABLE dpt_trans ADD COLUMN id SERIAL PRIMARY KEY;
+ALTER TABLE exchangerate ADD COLUMN id SERIAL PRIMARY KEY;
+ALTER TABLE finanzamt ADD COLUMN id SERIAL PRIMARY KEY;
+ALTER TABLE follow_up_access ADD COLUMN id SERIAL PRIMARY KEY;
+ALTER TABLE gifi ADD COLUMN id SERIAL PRIMARY KEY;
+ALTER TABLE inventory ADD COLUMN id SERIAL PRIMARY KEY;
+ALTER TABLE licenseinvoice ADD COLUMN id SERIAL PRIMARY KEY;
+ALTER TABLE partsgroup ADD PRIMARY KEY (id);
+ALTER TABLE partstax ADD COLUMN id SERIAL PRIMARY KEY;
+ALTER TABLE prices ADD COLUMN id SERIAL PRIMARY KEY;
+ALTER TABLE record_links ADD COLUMN id SERIAL PRIMARY KEY;
+ALTER TABLE rmaitems ADD PRIMARY KEY (id);
+ALTER TABLE status ADD COLUMN id SERIAL PRIMARY KEY;
+ALTER TABLE tax_zones ADD PRIMARY KEY (id);
+ALTER TABLE todo_user_config ADD COLUMN id SERIAL PRIMARY KEY;
+ALTER TABLE translation ADD COLUMN id SERIAL PRIMARY KEY;
+ALTER TABLE translation_payment_terms ADD COLUMN id SERIAL PRIMARY KEY;
+ALTER TABLE units_language ADD COLUMN id SERIAL PRIMARY KEY;
+ALTER TABLE vendortax ADD COLUMN id SERIAL PRIMARY KEY;
