Forums

Home » Liferay IDE » English

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Jason Kastner
Service Builder (modify existing table columns?)
August 15, 2011 7:54 AM
Answer

Jason Kastner

Rank: New Member

Posts: 3

Join Date: July 12, 2011

Recent Posts

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
David H Nebinger
RE: Service Builder (modify existing table columns?)
August 15, 2011 8:07 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 11046

Join Date: September 1, 2006

Recent Posts

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
RE: Service Builder (modify existing table columns?)
August 15, 2011 8:09 AM
Answer

Jason Kastner

Rank: New Member

Posts: 3

Join Date: July 12, 2011

Recent Posts

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.
David H Nebinger
RE: Service Builder (modify existing table columns?)
August 15, 2011 9:23 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 11046

Join Date: September 1, 2006

Recent Posts

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.
Jitendra Rajput
RE: Service Builder (modify existing table columns?)
August 27, 2011 7:31 AM
Answer

Jitendra Rajput

Rank: Liferay Master

Posts: 858

Join Date: January 7, 2011

Recent Posts

Check for log if is that any Build number error then it will not modify tables inside database....
Joe D
RE: Service Builder (modify existing table columns?)
November 16, 2012 1:10 PM
Answer

Joe D

Rank: New Member

Posts: 12

Join Date: April 19, 2012

Recent Posts

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