Set up change tracking in core tables

This commit is contained in:
2025-02-02 15:06:20 -05:00
parent 12cab7473a
commit 22ad2d44db
9 changed files with 216 additions and 94 deletions

View File

@@ -102,6 +102,16 @@ async function main() {
if (isImportCancelled) throw new Error("Import cancelled");
// Initialize product_metric_status table for any missing products
await localConnection.query(`
INSERT IGNORE INTO product_metric_status (pid)
SELECT pid FROM products p
WHERE NOT EXISTS (
SELECT 1 FROM product_metric_status pms
WHERE pms.pid = p.pid
)
`);
// Clean up any previously running imports that weren't completed
await localConnection.query(`
UPDATE import_history