+ sqlText += "\tPRIMARY KEY (" + key + ")";
+ foreignKey.forEach( f => {
+ let refParts = f.ref.split("(");
+ const table = refParts[0];
+ const field = refParts[1].slice(0,-1); //remove last parenthesis
+ sqlText += ",\n\tFOREIGN KEY (" + f.name + ") REFERENCES " + table + "(" + field + ")";
+ });
+ sqlText += "\n);\n";