From e79ca200a90fab8e2e1367fd53d648bf6fd41954 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 6 May 2015 12:03:01 -0500 Subject: [PATCH] IDEMPIERE-965 the create table process must also create the unique index for the UU column when found - fix issue with oracle index names longer than 30 char --- org.adempiere.base/src/org/compiere/model/MColumn.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MColumn.java b/org.adempiere.base/src/org/compiere/model/MColumn.java index d8b9e45c67..ba2a38bc85 100644 --- a/org.adempiere.base/src/org/compiere/model/MColumn.java +++ b/org.adempiere.base/src/org/compiere/model/MColumn.java @@ -604,9 +604,8 @@ public class MColumn extends X_AD_Column if (getColumnName().equals(PO.getUUIDColumnName(tableName))) { StringBuilder indexName = new StringBuilder().append(getColumnName()).append("_idx"); if (indexName.length() > 30) { - int i = indexName.length() - 31; - indexName = new StringBuilder().append(getColumnName().substring(0, getColumnName().length() - i)); - indexName.append("_uu_idx"); + indexName = new StringBuilder().append(getColumnName().substring(0, 25)); + indexName.append("uuidx"); } StringBuilder msgreturn = new StringBuilder("CONSTRAINT ").append(indexName).append(" UNIQUE (").append(getColumnName()).append(")"); return msgreturn.toString();