From 98e2e4073a6ad33e492335bf2ae21bea75530e82 Mon Sep 17 00:00:00 2001 From: Matt Date: Tue, 11 Feb 2025 14:31:01 -0500 Subject: [PATCH] Exclude calculate history table from resets --- inventory-server/scripts/reset-db.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inventory-server/scripts/reset-db.js b/inventory-server/scripts/reset-db.js index 8cc437f..0e79013 100644 --- a/inventory-server/scripts/reset-db.js +++ b/inventory-server/scripts/reset-db.js @@ -156,7 +156,7 @@ async function resetDatabase() { SELECT GROUP_CONCAT(table_name) as tables FROM information_schema.tables WHERE table_schema = DATABASE() - AND table_name NOT IN ('users', 'import_history') + AND table_name NOT IN ('users', 'import_history', 'calculate_history') `); if (!tables[0].tables) { @@ -175,7 +175,7 @@ async function resetDatabase() { DROP TABLE IF EXISTS ${tables[0].tables .split(',') - .filter(table => table !== 'users') + .filter(table => !['users', 'calculate_history'].includes(table)) .map(table => '`' + table + '`') .join(', ')} `;