Exclude calculate history table from resets

This commit is contained in:
2025-02-11 14:31:01 -05:00
parent 23c2085f1c
commit 98e2e4073a

View File

@@ -156,7 +156,7 @@ async function resetDatabase() {
SELECT GROUP_CONCAT(table_name) as tables SELECT GROUP_CONCAT(table_name) as tables
FROM information_schema.tables FROM information_schema.tables
WHERE table_schema = DATABASE() 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) { if (!tables[0].tables) {
@@ -175,7 +175,7 @@ async function resetDatabase() {
DROP TABLE IF EXISTS DROP TABLE IF EXISTS
${tables[0].tables ${tables[0].tables
.split(',') .split(',')
.filter(table => table !== 'users') .filter(table => !['users', 'calculate_history'].includes(table))
.map(table => '`' + table + '`') .map(table => '`' + table + '`')
.join(', ')} .join(', ')}
`; `;