diff --git a/packages/basic.gblib/services/GBVMService.ts b/packages/basic.gblib/services/GBVMService.ts index 5e71eaf4..c0d2f2ef 100644 --- a/packages/basic.gblib/services/GBVMService.ts +++ b/packages/basic.gblib/services/GBVMService.ts @@ -415,6 +415,12 @@ export class GBVMService extends GBService { }); sync = sync ? sync : !found; + + // Do not erase tables in case of an error in collection retrieval. + + if (tables.length === 0){ + sync = false; + } associations.forEach(e => { const from = seq.models[e.from]; diff --git a/packages/basic.gblib/services/SystemKeywords.ts b/packages/basic.gblib/services/SystemKeywords.ts index 87d6e4fd..0494f1a6 100644 --- a/packages/basic.gblib/services/SystemKeywords.ts +++ b/packages/basic.gblib/services/SystemKeywords.ts @@ -2912,7 +2912,7 @@ export class SystemKeywords { const dialect = con.dialect.name; // Step 3: Get the list of all tables from the source database - const tables = await GBUtil.listTables(dialect, min.core.sequelize); + const tables = await GBUtil.listTables(dialect, con); // Function to map source database datatypes to SQLite-compatible datatypes const mapToSQLiteType = (columnType) => {