As you develop modules, you might need to iterate through several database schema changes. Before you release new module versions with your finalized schema changes, you must create a formal data upgrade process. Until then, you can use the Build Auto Upgrade feature to test schema changes on the fly.
Follow these steps to use the Build Auto Upgrade feature to test schema changes in development:
portal-ext.propertiesfile in your app server’s
[Liferay_Home]/folder if it doesn’t already exist.
Enable Developer Mode in your app server by adding the following line to the properties file:
The Build Auto Upgrade feature is a global property
schema.module.build.auto.upgradein the file
[Liferay_Home]/portal-developer.properties, so enabling Developer Mode automatically enables this property as well.
Alternatively, if you prefer not to enable all the other properties included in Developer Mode, you can just add the
schema.module.build.auto.upgradeproperty to your
portal-ext.propertiesfile and set it to
schema.module.build.auto.upgrade = true;
Setting the global property
module schema changes for redeployed modules whose service build numbers have
build.number property in the module’s
file indicates the service build number. Build Auto Upgrade executes schema
changes without massaging existing data. It leaves data empty for created
columns, drops data from deleted and renamed columns, and orphans data from
deleted and renamed tables.
Although Build Auto Upgrade updates databases quickly and automatically, it doesn’t guarantee a proper data upgrade–you implement that via data upgrade processes. Build Auto Upgrade is for development purposes only.
schema.module.build.auto.upgrade is set to
false. On any
module’s first deployment, the module’s tables are generated regardless of the
The table below summarizes Build Auto Upgrade’s handling of schema changes:
|Add column||Create a new empty column.|
|Rename column||Drop the existing column and delete all its data. Create a new empty column.|
|Delete column||Drop the existing column and delete all its data.|
|Create or rename a table in Liferay DXP’s built-in data source.||Orphan the existing table and all its data. Create the new table.|
Great! Now you know how to use the Build Auto Upgrade developer feature.