From 0fa594312506ed2b3a1e73f7a14e8672377f5f24 Mon Sep 17 00:00:00 2001 From: Mauro Altamura Date: Fri, 15 Oct 2021 17:23:28 +0200 Subject: [PATCH 1/2] EC-367: Changed ses_unit_price Field to be ezfloat Added SQL script to upgrade ses_product content type and upgrade ses_price field on exising products --- upgrade/db/mysql/ezplatform-2.5.sql | 40 +++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 upgrade/db/mysql/ezplatform-2.5.sql diff --git a/upgrade/db/mysql/ezplatform-2.5.sql b/upgrade/db/mysql/ezplatform-2.5.sql new file mode 100644 index 0000000000..1411ecf641 --- /dev/null +++ b/upgrade/db/mysql/ezplatform-2.5.sql @@ -0,0 +1,40 @@ +UPDATE + ezcontentclass_attribute +SET + data_type_string = 'ezfloat' +WHERE + contentclass_id = ( + SELECT + id + FROM + ezcontentclass + WHERE + identifier = 'ses_product' + ) + AND identifier = 'ses_unit_price'; + +UPDATE + ezcontentobject_attribute +SET + data_float = CAST( + replace(data_text, ',', '.') AS DECIMAL(65, 2) + ), + data_type_string = 'ezfloat' +WHERE + contentclassattribute_id = ( + SELECT + id + FROM + ezcontentclass_attribute + WHERE + contentclass_id = ( + SELECT + id + FROM + ezcontentclass + WHERE + identifier = 'ses_product' + ) + AND identifier = 'ses_unit_price' + ); + From cf328246c1a5ecfd42e5c89f6bfd291e967632cc Mon Sep 17 00:00:00 2001 From: Mauro Altamura Date: Wed, 9 Feb 2022 17:15:12 +0100 Subject: [PATCH 2/2] EC-367: Changed ses_unit_price Field to be ezfloat Added postgresql script --- upgrade/db/postgresql/ezplatform-2.5.sql | 40 ++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 upgrade/db/postgresql/ezplatform-2.5.sql diff --git a/upgrade/db/postgresql/ezplatform-2.5.sql b/upgrade/db/postgresql/ezplatform-2.5.sql new file mode 100644 index 0000000000..1411ecf641 --- /dev/null +++ b/upgrade/db/postgresql/ezplatform-2.5.sql @@ -0,0 +1,40 @@ +UPDATE + ezcontentclass_attribute +SET + data_type_string = 'ezfloat' +WHERE + contentclass_id = ( + SELECT + id + FROM + ezcontentclass + WHERE + identifier = 'ses_product' + ) + AND identifier = 'ses_unit_price'; + +UPDATE + ezcontentobject_attribute +SET + data_float = CAST( + replace(data_text, ',', '.') AS DECIMAL(65, 2) + ), + data_type_string = 'ezfloat' +WHERE + contentclassattribute_id = ( + SELECT + id + FROM + ezcontentclass_attribute + WHERE + contentclass_id = ( + SELECT + id + FROM + ezcontentclass + WHERE + identifier = 'ses_product' + ) + AND identifier = 'ses_unit_price' + ); +