This commit is contained in:
Jan Prochazka
2020-03-05 09:44:38 +01:00
parent aad9512951
commit 0507e84457

View File

@@ -172,6 +172,7 @@ class SqlDumper {
* @param {(col: T) => void} lambda * @param {(col: T) => void} lambda
*/ */
putCollection(delimiter, collection, lambda) { putCollection(delimiter, collection, lambda) {
if (!collection) return;
let first = true; let first = true;
for (const item of collection) { for (const item of collection) {
if (!first) this.put(delimiter); if (!first) this.put(delimiter);
@@ -196,10 +197,12 @@ class SqlDumper {
table.primaryKey.columns.map(x => x.columnName) table.primaryKey.columns.map(x => x.columnName)
); );
} }
table.foreignKeys.forEach(fk => { if (table.foreignKeys) {
this.put(",&n"); table.foreignKeys.forEach(fk => {
this.createForeignKeyFore(fk); this.put(",&n");
}); this.createForeignKeyFore(fk);
});
}
// foreach (var cnt in table.Uniques) // foreach (var cnt in table.Uniques)
// { // {
// if (!first) this.put(", &n"); // if (!first) this.put(", &n");