Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Liferay 7 Service Builder doesn't auto update the database

In my Liferay 7 project, the Service Builder generates well the file tables.sql (with the complete sql) but doesn't include this content in the SERVICECOMPONENT native liferay table as it did for Liferay 6.2.

Therefore, when I restart the server, there is no update in the database whereas the data model has been modified.

I have to run manually the sql script included in tables.sql to solve temporarily the issue.

Does someone has reproduced this ? Is there any option (new in Liferay 7 ?) that I didn't know which can lead to this behavior.

Note : Of course, the option build.auto.upgrade (in service.properties) is set to true and there is no service-ext.properties which could override this

like image 806
Vincent Avatar asked Dec 02 '22 13:12

Vincent


1 Answers

Liferay Community has updated the post adding steps to this post,

While you’re developing your application, you can force your service tables to regenerate when you modify them by following these steps:

  • Drop the tables for your service.
  • Delete the row for your service in the release_ table.
  • Delete the row for your service in the servicecomponent table.

Here’s an example in SQL:

DROP TABLE LRBO_HORSE_HORSE;
DELETE FROM SERVICECOMPONENT WHERE BUILDNAMESPACE = 'LRBO_HORSE';
DELETE FROM RELEASE_ WHERE SERVLETCONTEXTNAME = 'horse-service';

Follow this link for more details,

Thanks Daniele Baggio for giving pointers.

like image 90
pratik Avatar answered Dec 21 '22 18:12

pratik