Clear the associations first

This commit is contained in:
Owen
2025-12-07 15:19:40 -05:00
parent 042c88ccb8
commit 40c38fa070

View File

@@ -271,6 +271,11 @@ export default async function migration() {
const insertClientSiteResource = db.prepare(
`INSERT INTO 'clientSiteResources' ('clientId', 'siteResourceId') VALUES (?, ?)`
);
// clear the clientSiteResourcesAssociationsCache and clientSitesAssociationsCache tables to prepare for repopulation
db.prepare(`DELETE FROM 'clientSiteResourcesAssociationsCache';`).run();
db.prepare(`DELETE FROM 'clientSitesAssociationsCache';`).run();
const insertClientSiteResourceAssocCache = db.prepare(
`INSERT INTO 'clientSiteResourcesAssociationsCache' ('clientId', 'siteResourceId') VALUES (?, ?)`
);