Thanks but Lob for a phone string is a bit large isn’t it ?
I already tried length = 20, which is enough in our case, and it does not work : setting length on @Column with datatype does not work with Cuba, length is removed by Studio.
However column definition varchar(20) works.
I’m not sure wether this 15 comes from Cuba or Postgre.
Hi,
We cannot reproduce the issue. Could you prepare a little demo-project or share the source code of the PhoneDataType class?
Also, check which scripts were generated by Studio and which type has the column in the database (use DBMS manager).
I think I finally narrowed the problem. Changing the SQL definition of a varchar datatype is not detected as an update by Studio when you click on “generate DB scripts”.
This is why I was thinking there was a limitation to 15 chars somewhere, but there is none. Simply, the phone attribute was initially varchar(15) and then we moved to a datatype with no precise SQL definition, which makes Studio yields “varchar” (unlimited). But there was no update script generated, so the column stayed to varchar(15) in PGSQL, hence the issue.
Attached a small project, which show another similar issue : using Konstantin solution to define sqlType, Studio changes correctly the DDL of the entity for the ‘create-db’ but does not detect there should be an update script generated.
Seems like when Studio generates DB update scripts, the length of the varchar is not taken into account to decide if there is a DDL change on the column.