From 5d87eb5c5594eae12a57713132dce628613b2b78 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 22 Dec 2014 10:03:45 -0500 Subject: [PATCH] IDEMPIERE-2368 Synchronize column not create table if virtual column is first / thanks to Nikita Polkovnikov --- org.adempiere.base/src/org/compiere/model/MTable.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MTable.java b/org.adempiere.base/src/org/compiere/model/MTable.java index 5c1ba0795f..adac3df0d0 100644 --- a/org.adempiere.base/src/org/compiere/model/MTable.java +++ b/org.adempiere.base/src/org/compiere/model/MTable.java @@ -540,15 +540,18 @@ public class MTable extends X_AD_Table // boolean hasParents = false; StringBuffer constraints = new StringBuffer(); getColumns(true); + boolean columnAdded = false; for (int i = 0; i < m_columns.length; i++) { MColumn column = m_columns[i]; String colSQL = column.getSQLDDL(); if ( colSQL != null ) { - if (i > 0) + if (columnAdded) sb.append(", "); - sb.append(column.getSQLDDL()); + else + columnAdded = true; + sb.append(column.getSQLDDL()); } else // virtual column continue;