Foros de discusión

Liferay Default Column size

thumbnail
Mathieu Hicauber, modificado hace 11 años.

Liferay Default Column size

Junior Member Mensajes: 79 Fecha de incorporación: 22/12/10 Mensajes recientes
Hi,

I know there's a wiki topic covering the subject (http://www.liferay.com/community/wiki/-/wiki/Main/Customize+DB+Column+Sizes) , but I'm stucked with this : how to change the column size of an existing liferay table ?

I'd like to increase the length of the articleId column of the journalContent portlet from 75 to, let's say, 200.

So I created an ext-model-hints.xml file in my ext plugin with my custom max-length attribute for the model, and redeployed my plugin. That doesn't do the trick.

I saw on multiple thread people talking aout re-generating services with the build-services ant task. Does it implie to copy the journal model in a service.xml file in the ext plugin ? I don't get it....

Thank you,

Mathieu.
thumbnail
Mika Koivisto, modificado hace 11 años.

RE: Liferay Default Column size

Liferay Legend Mensajes: 1519 Fecha de incorporación: 7/08/06 Mensajes recientes
If you want to change a existing table column length you need to edit portal-model-hints.xml and regenerate services. All this needs to be done from the portal source doing it from ext won't help. If you already have the database created with old column size you need to add a upgrade script or change it directly to the database. In any case you shouldn't mess with the portal core.
thumbnail
Mathieu Hicauber, modificado hace 11 años.

RE: Liferay Default Column size

Junior Member Mensajes: 79 Fecha de incorporación: 22/12/10 Mensajes recientes
Hi,

Thank you for your answer.

Mika Koivisto:
In any case you shouldn't mess with the portal core.


Do you mean I shouldn't do that ?

Mika Koivisto:
you need to add a upgrade script or change it directly to the database


I changed it in the database, but still have a "Data too long for column..." data truncation error when the servie tries to add the article in the DB.
thumbnail
Harish Kumar, modificado hace 11 años.

RE: Liferay Default Column size

Expert Mensajes: 483 Fecha de incorporación: 31/07/10 Mensajes recientes
Hi Mathieu,

Changing the column size directly in DB won't work as Liferay implementation classes have checks to truncate data that goes beyond specified default length.

you have to go through the ext plugin way. Make sure you making changes to ext-impl/src/META-INF/ext-model-hints.xml

HTH
thumbnail
Mathieu Hicauber, modificado hace 11 años.

RE: Liferay Default Column size

Junior Member Mensajes: 79 Fecha de incorporación: 22/12/10 Mensajes recientes
Hi Harish,

Thank you for your answer.
I already made changes in the ext-model-hints.xml file. I just don't get how to regenerate the validation layer.

Mathieu.
thumbnail
Harish Kumar, modificado hace 11 años.

RE: Liferay Default Column size

Expert Mensajes: 483 Fecha de incorporación: 31/07/10 Mensajes recientes
Please check this thread. I think there is a way to persist the changes to ext-model-hints.xml file.
thumbnail
Mathieu Hicauber, modificado hace 11 años.

RE: Liferay Default Column size

Junior Member Mensajes: 79 Fecha de incorporación: 22/12/10 Mensajes recientes
I'll check that thank you.