Issue
Service Builder changes does not apply updates on database after add or delete a column in service.xml
Environment
- Quarterly Releases
Resolution
Liferay has the property schema.module.build.auto.upgrade set to false by default. Unless you set this property to true in your environment, the auto upgrade will not be executed and changes to the database will not be applied.
As mentioned in the Liferay documentation, Liferay DXP DOES NOT support Build Auto Upgrade in production. The steps to upgrade changes in service.xml are explained below:
- Create an upgradeStep as described in this link.
- After creating the upgradeStep defining table changes, execute the buildService task and deploy the -service and -api modules.
- Once deployed, go to Gogo Shell and execute the upgrade:
upgrade:execute [module_name]
//Verify execution:
upgrade:list [module_name]
After applying these steps, your Service Builder will be updated and columns will be added or removed (you can also create indexes). Changes will also be reflected in the Release_ and ServiceComponent tables.
Additional information
- https://help.liferay.com/hc/en-us/articles/360031165751-Creating-Upgrade-Processes-for-Modules
- https://help.liferay.com/hc/en-us/articles/360031165791-Upgrading-Data-Schemas-in-Development
- https://learn.liferay.com/w/dxp/installation-and-upgrades/upgrading-liferay/upgrade-stability-and-performance/upgrading-modules-using-gogo-shell
- https://learn.liferay.com/w/dxp/liferay-development/building-applications/data-frameworks/upgrade-processes/upgrading-your-database-tables