Affects Version/s: 6.2.X EE, 7.0.X, 7.1.X, 7.2.X, Master
Component/s: Dynamic Data Mapping > Upgrades
Duplicated data in DDMTemplate table prevents index IX_E6DFAB84 during upgrade from 6.1 to 6.2, 7.0 or 7.1.
The root cause of the issue is new templateKey column is added in 6.2 but it is partially initialized in UpgradeDynamicDataMapping.java, we are only processing DDMTemplate entries with language = xsd, for more information, see
LPS-41936 and LPS-41975
This issue is only reproduced in Oracle database as it doesn't allow creating a unique index with more than one NULL value in a column.
Other databases as postgresql or mysql allows it, so the error is not produced.
Steps to reproduce
- Install Liferay 6.1 GA2
- Create a DDL data definition
- Create two list templates in the DDL data definition. the issue is only reproduced if you use list templates
- Upgrade the Liferay installation:
- Direct upgrade from 6.1 to master or 7.2 is not supported
- You have to stop in a intermediate version, executing two upgrade steps
- For example:
- Option 1: 6.1 => 6.2 and 6.2 => master
- Option 2: 6.1 => 7.1 and 7.1 => master
- Check DDMTemplate table and the upgrade log file:
- : Unique index IX_E6DFAB84 is created in DDMTemplate
- : Unique index IX_E6DFAB84 is not created in DDMTemplate and following warning is written to log file
Note: as we have to execute two upgrade process, the ORA-01452: cannot CREATE UNIQUE INDEX; warning will be produced in the first upgrade that starts in 6.1, but it can safely ignored because index are recreated in all upgrade operations. If the warning is not shown in second upgrade that ends in master, it will be fine.