From 72f018a6943ea8776f163e12f37bc0d91000b9aa Mon Sep 17 00:00:00 2001 From: "G. Richardson" Date: Tue, 9 Apr 2013 12:39:40 +0200 Subject: [PATCH] Boolean-Felder in acc_trans auf not null setzen MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Es gibt dort zwar ein "default false", aber Buchungen von vor dem "default false" können noch auf NULL stehen. Dadurch kommen manche Berichte wie die Bilanz, wo z.B. explizit auf "cb_transaction is false" geprüft wird, auf falsche Zahlen. --- sql/Pg-upgrade2/acc_trans_booleans_not_null.sql | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 sql/Pg-upgrade2/acc_trans_booleans_not_null.sql diff --git a/sql/Pg-upgrade2/acc_trans_booleans_not_null.sql b/sql/Pg-upgrade2/acc_trans_booleans_not_null.sql new file mode 100644 index 000000000..983e53d75 --- /dev/null +++ b/sql/Pg-upgrade2/acc_trans_booleans_not_null.sql @@ -0,0 +1,14 @@ +-- @tag: acc_trans_booleans_not_null +-- @description: Alte acc_trans boolean-Einträge mit NULL-Werten auf false setzen +-- @depends: release_3_0_0 +-- @charset: utf-8 + +UPDATE acc_trans SET cleared = 'f' where cleared IS NULL; +UPDATE acc_trans SET ob_transaction = 'f' where ob_transaction IS NULL; +UPDATE acc_trans SET cb_transaction = 'f' where cb_transaction IS NULL; +UPDATE acc_trans SET fx_transaction = 'f' where fx_transaction IS NULL; + +ALTER TABLE acc_trans ALTER cleared SET NOT NULL; +ALTER TABLE acc_trans ALTER ob_transaction SET NOT NULL; +ALTER TABLE acc_trans ALTER cb_transaction SET NOT NULL; +ALTER TABLE acc_trans ALTER fx_transaction SET NOT NULL; -- 2.20.1