Fórum

Service Builder (modify existing table columns?)

Jason Kastner, modificado 12 Anos atrás.

Service Builder (modify existing table columns?)

New Member Postagens: 3 Data de Entrada: 12/07/11 Postagens Recentes
If I modify my service.xml and add new values that will create new columns for my database table. The new columns are not created. Is this functionality of modifying columns just not part of service builder? I have tried with the Helios IDE and have also updated to the new Indigo Eclipse and the IDE nightly builds.

I have tried undeploying portlets before rebuilding the service too but just undeploying a portlet doesn't clean out the database tables. Is there an official way to clear out all existence of a portlet in the db? I have had to just do fresh databases in my dev environment, but this isn't really an option for our production server.

Thanks for any help,
Jason
thumbnail
David H Nebinger, modificado 12 Anos atrás.

RE: Service Builder (modify existing table columns?)

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
The SB code will create a table if it does not exist, but it will not interrogate the table to determine that an upgrade is needed.

This is something that you will have to manage yourself. There are update hooks in Liferay that you can plug into to help you make this happen, but you'd have to check it out to see if it is not adding more complexity to your project than what is necessary.
Jason Kastner, modificado 12 Anos atrás.

RE: Service Builder (modify existing table columns?)

New Member Postagens: 3 Data de Entrada: 12/07/11 Postagens Recentes
Thanks for the quick response.

I will take a look at the update hooks. I am pretty sure I manually tried to drop the table myself and have service builder rebuild the new table when it doesn't find it, but I am pretty sure I got some grisly errors and was thinking there were some other database references I didn't know about that might have to be cleaned out too before new table is created.
thumbnail
David H Nebinger, modificado 12 Anos atrás.

RE: Service Builder (modify existing table columns?)

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
Your biggest issue would be timing. You should make sure your updated jar is deployed, stop the app server, drop the table, then restart the app server. When your service loads, it should see the table is not there and re-create it.
Joe D, modificado 11 Anos atrás.

RE: Service Builder (modify existing table columns?)

New Member Postagens: 12 Data de Entrada: 19/04/12 Postagens Recentes
HI David,

I'm using SB on Liferay 6.1. Every time I added new tables data on existing tables are deleted. Do you know if it drop old tables and re-create them? Thanks
thumbnail
Jitendra Rajput, modificado 12 Anos atrás.

RE: Service Builder (modify existing table columns?)

Liferay Master Postagens: 875 Data de Entrada: 07/01/11 Postagens Recentes
Check for log if is that any Build number error then it will not modify tables inside database....