From: Stephan Köhler Date: Mon, 9 Jan 2006 15:56:59 +0000 (+0000) Subject: Merge von 762 aus unstable: Bugfix Primary Key und Sql-Fehler beim Pg-upgrade X-Git-Tag: release-2.2.0~40 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=d4c280d5d8f3640b86a1ac4c8007ed809dd45d15;p=kivitendo-erp.git Merge von 762 aus unstable: Bugfix Primary Key und Sql-Fehler beim Pg-upgrade Probleme mit Primary Key in orderitems behoben Anmerkung: In einer bestehenden Datenbank muss der Primary Key auf der id von orderitems manuell entfernt werden, sonst gibt es auf einigen Systemen beim Generieren eines Auftrages Probleme. --- diff --git a/sql/Pg-upgrade-2.1.1-2.1.2.sql b/sql/Pg-upgrade-2.1.1-2.1.2.sql index 5800d73c7..547f97ccc 100644 --- a/sql/Pg-upgrade-2.1.1-2.1.2.sql +++ b/sql/Pg-upgrade-2.1.1-2.1.2.sql @@ -182,7 +182,6 @@ alter table employee add primary key (id); alter table warehouse add primary key (id); alter table business add primary key (id); alter table license add primary key (id); -alter table orderitems add primary key (id); alter table acc_trans add foreign key (chart_id) references chart (id); alter table invoice add foreign key (parts_id) references parts (id); @@ -234,15 +233,14 @@ ALTER TABLE customer ALTER column klass set default 0; ALTER TABLE invoice ADD column pricegroup_id integer; ALTER TABLE orderitems ADD column pricegroup_id integer; -update defaults set version = '2.1.2', audittrail = 't'; -- USTVA Update solve Bug 49 conributed by Andre Schubert update chart set pos_ustva='861' where accno='1771'; update chart set pos_ustva='511' where accno='1775'; -update chart set pos_ustva='511' where pos_ustva='51r'; -update chart set pos_ustva='861' where pos_ustva='86r'; -update chart set pos_ustva='971' where pos_ustva='97r'; -update chart set pos_ustva='931' where pos_ustva='93r'; +-- update chart set pos_ustva='511' where pos_ustva='51r'; +-- update chart set pos_ustva='861' where pos_ustva='86r'; +-- update chart set pos_ustva='971' where pos_ustva='97r'; +-- update chart set pos_ustva='931' where pos_ustva='93r'; -- add fields for ordnumber/transdate/cusordnumber in invoice/orderitems (r690 cleanup) alter table orderitems add column ordnumber text; @@ -253,3 +251,4 @@ alter table invoice add column transdate text; alter table invoice add column cusordnumber text; -- +update defaults set version = '2.1.2'; diff --git a/sql/lx-office.sql b/sql/lx-office.sql index 240803396..439b119bb 100644 --- a/sql/lx-office.sql +++ b/sql/lx-office.sql @@ -397,7 +397,7 @@ CREATE TABLE "orderitems" ( "reqdate" date, "ship" real, "serialnumber" text, - "id" integer DEFAULT nextval('orderitemsid'::text) PRIMARY KEY, + "id" integer DEFAULT nextval('orderitemsid'::text), "itime" timestamp DEFAULT now(), "mtime" timestamp, "pricegroup_id" integer,