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' + ); + 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' + ); +