From: Philip Reetz Date: Mon, 11 Dec 2006 09:36:39 +0000 (+0000) Subject: Datenbankupgrade fuer neue Steuerschluessel nach Datevvorgabe X-Git-Tag: release-2.4.0^2~95 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=6f2536925217832bf8e310d57b8e77137701c1ca;p=kivitendo-erp.git Datenbankupgrade fuer neue Steuerschluessel nach Datevvorgabe --- 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