From faa0e892e7fd698c438b6656f378ee99c5cf95d9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stephan=20K=C3=B6hler?= Date: Thu, 24 Nov 2005 16:37:27 +0000 Subject: [PATCH] Merge von 584 aus unstable: Datenbankschema erweitert fuer Audit Informationen --- sql/Pg-upgrade-2.1.1-2.1.2.sql | 16 +++++++++++++++- sql/lx-office.sql | 13 ++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) 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 7ff54927a..8973fd09e 100644 --- a/sql/Pg-upgrade-2.1.1-2.1.2.sql +++ b/sql/Pg-upgrade-2.1.1-2.1.2.sql @@ -132,6 +132,8 @@ alter table vendor add column salesman_id integer; alter table shipto add column shiptodepartment_1 varchar(75); alter table shipto add column shiptodepartment_2 varchar(75); + + -- Addon for business alter table business add column salesman boolean; alter table business alter column salesman set default 'false'; @@ -183,6 +185,18 @@ update vendor set temp_account_number=account_number; alter table vendor drop column account_number; alter table vendor rename temp_account_number to account_number; -update defaults set version = '2.1.2'; +-- audit +alter table defaults add column audittrail bool; +CREATE TABLE audittrail ( + trans_id int, + tablename text, + reference text, + formname text, + action text, + transdate timestamp default current_timestamp, + employee_id int +); + +update defaults set version = '2.1.2', audittrail = 't'; -- diff --git a/sql/lx-office.sql b/sql/lx-office.sql index 18f27aae7..6ccc09931 100644 --- a/sql/lx-office.sql +++ b/sql/lx-office.sql @@ -109,12 +109,23 @@ CREATE TABLE "defaults" ( "rfqnumber" text, "customernumber" text, "vendornumber" text, + "audittrail" bool default 'f', "articlenumber" text, "servicenumber" text, "itime" timestamp DEFAULT now(), "mtime" timestamp ); -INSERT INTO defaults (version) VALUES ('2.1.2'); +INSERT INTO defaults (version,audittrail) VALUES ('2.1.2', 't'); + +CREATE TABLE audittrail ( + "trans_id" int, + "tablename" text, + "reference" text, + "formname" text, + "action" text, + "transdate" timestamp default current_timestamp, + "employee_id" int +); CREATE TABLE "acc_trans" ( "trans_id" integer, -- 2.20.1