From 61d057576d0c055e18c8be6fc0d58394e0760748 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 26 Feb 2007 04:15:10 +0000 Subject: [PATCH] fix bug 2pack not creating primary key on tables - tested in oracle still not working in postgres because of convert issues --- dbPort/src/org/compiere/model/MColumn.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dbPort/src/org/compiere/model/MColumn.java b/dbPort/src/org/compiere/model/MColumn.java index b14242d3a9..d8ae454f32 100644 --- a/dbPort/src/org/compiere/model/MColumn.java +++ b/dbPort/src/org/compiere/model/MColumn.java @@ -274,6 +274,12 @@ public class MColumn extends X_AD_Column StringBuffer sql = new StringBuffer ("ALTER TABLE ") .append(table.getTableName()) .append(" ADD ").append(getSQLDDL()); + String constraint = getConstraint(table.getTableName()); + if (constraint != null && constraint.length() > 0) { + sql.append("; ").append("ALTER TABLE ") + .append(table.getTableName()) + .append(" ADD ").append(constraint); + } return sql.toString(); } // getSQLAdd