From 6f2536925217832bf8e310d57b8e77137701c1ca Mon Sep 17 00:00:00 2001 From: Philip Reetz Date: Mon, 11 Dec 2006 09:36:39 +0000 Subject: [PATCH] Datenbankupgrade fuer neue Steuerschluessel nach Datevvorgabe --- sql/Pg-upgrade/Pg-upgrade-2.2.0.30-2.2.0.31.sql | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 sql/Pg-upgrade/Pg-upgrade-2.2.0.30-2.2.0.31.sql diff --git a/sql/Pg-upgrade/Pg-upgrade-2.2.0.30-2.2.0.31.sql b/sql/Pg-upgrade/Pg-upgrade-2.2.0.30-2.2.0.31.sql new file mode 100644 index 000000000..532e22c97 --- /dev/null +++ b/sql/Pg-upgrade/Pg-upgrade-2.2.0.30-2.2.0.31.sql @@ -0,0 +1,14 @@ +create table taxkeys ( + "id" integer DEFAULT nextval('id'::text) PRIMARY KEY, + "chart_id" integer, + "tax_id" integer, + "taxkey_id" integer, + "pos_ustva" integer, + "startdate" date +); + +alter table tax add column id integer; +alter table tax alter column id set DEFAULT nextval('id'::text); +update tax set id=nextval('id'); + +insert into taxkeys (chart_id, tax_id, taxkey_id, pos_ustva, startdate) select chart.id, tax.id, taxkey_id, pos_ustva, '1970-01-01' from chart LEFT JOIN tax on (tax.taxkey=chart.taxkey_id) WHERE taxkey_id is not null; \ No newline at end of file -- 2.20.1