X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/d527be3a4b43f028f39d35d1d8f5a34709a37c91..cd5afcd8835e4c8e625aea2a0a2a2edf86bf5653:/sql/Pg-upgrade-2.1.1-2.1.2.sql

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 91016951b..068ee2319 100644
--- a/sql/Pg-upgrade-2.1.1-2.1.2.sql
+++ b/sql/Pg-upgrade-2.1.1-2.1.2.sql
@@ -116,15 +116,17 @@ alter table vendor drop column creditlimitold;
 --New Fields for customer and vendor
 alter table vendor add column obsolete boolean;
 alter table vendor alter column obsolete set default 'false';
+update table vendor set obsolete='false';
 alter table customer add column obsolete boolean;
 alter table customer alter column obsolete set default 'false';
+update table customer set obsolete='false';
 alter table customer add column ustid varchar(12);
 alter table vendor add column ustid varchar(12);
 
 alter table customer add column username varchar(50);
 alter table vendor add column username varchar(50);
-alter table customer add column user_password varchar(12);
-alter table vendor add column user_password varchar(12);
+alter table customer add column user_password text;
+alter table vendor add column user_password text;
 alter table customer add column salesman_id integer;
 alter table vendor add column salesman_id integer;
 
@@ -182,7 +184,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);
@@ -223,7 +224,7 @@ CREATE TABLE "pricegroup" (
 
 CREATE TABLE "prices" (
   "parts_id" integer REFERENCES parts(id),
-  "pricegroup_id" integer REFERENCES pricegroup(id),
+  "pricegroup_id" integer,
   "price" numeric(15,5)
 );
 
@@ -234,11 +235,16 @@ 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';
---
 
--- add fields for ordnumber/transdate/cusordnumber in invoice/orderitems (r690 cleanup)
+-- 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';
 
+-- add fields for ordnumber/transdate/cusordnumber in invoice/orderitems (r690 cleanup)
 alter table orderitems add column ordnumber text;
 alter table orderitems add column transdate text;
 alter table orderitems add column cusordnumber text;
@@ -247,3 +253,11 @@ alter table invoice add column transdate text;
 alter table invoice add column cusordnumber text;
 --
 
+--
+-- add unqiue constraint to project
+ALTER TABLE project ADD constraint project_projectnumber_key UNIQUE(projectnumber);
+--
+-- add column deliverydate to ar
+ALTER TABLE ar ADD COLUMN deliverydate date;
+
+update defaults set version = '2.1.2';
