I am trying to increase column size to 1024 characters from default 255 characters. Note that this is an existing production item type(AbstractOrderEntry) & attribute(productDescription). system init is not possbile.
So far I have tried these 2 approaches.
Modified *-items.xml file.
<attribute qualifier="productDescription" type="java.lang.String"> <modifiers unique="false" optional="true" read="true" write="true"/> <persistence type="property"> <columntype database="oracle"> <value>varchar(1024)</value> </columntype> <columntype database="sqlserver"> <value>nvarchar(1024)</value> </columntype> <columntype database="hsqldb"> <value>VARCHAR(1024)</value> </columntype> <columntype> <value>varchar(1024)</value> </columntype> </persistence> </attribute>
- ant clean all & system update. Didn't work
Other approach was: Executed alter statement from mySql Workbench.
ALTER TABLE `hybrisDB`.`quoteentries`
CHANGE COLUMN `p_productdescription` `p_productdescription` VARCHAR(1024) NULL DEFAULT NULL ;
I could see that column size was increased from SQL workbench. But when I'm trying to save the value from Hybris, It throws runtime exception.
INFO | jvm 1 | main | 2019/11/26 14:27:20.262 | com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'p_productdescription' at row 1
INFO | jvm 1 | main | 2019/11/26 14:27:20.262 | at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4118)
INFO | jvm 1 | main | 2019/11/26 14:27:20.262 | at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4052)```
Restarted Hybris after executing direct SQL statement from DB.
Any other inputs?