From a810628f15dd943a94a452d82f4abf7ea392b7e3 Mon Sep 17 00:00:00 2001 From: Isaac Abadi Date: Sat, 17 Jul 2021 20:00:49 -0600 Subject: [PATCH] Fixed DB migration for tables with no docs --- backend/db.js | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/db.js b/backend/db.js index a5934cc..f12b62d 100644 --- a/backend/db.js +++ b/backend/db.js @@ -873,6 +873,7 @@ exports.importJSONToDB = async (db_json, users_json) => { let success = true; for (let i = 0; i < table_keys.length; i++) { const table_key = table_keys[i]; + if (!tables_obj[table_key] || tables_obj[table_key].length === 0) continue; success &= await exports.insertRecordsIntoTable(table_key, tables_obj[table_key]); }