← back to Filemaker Mcp

scripts/delete-dup-536613.mjs

25 lines

// DWTA Baxter dedup — delete the automation-created duplicate FM record 536613.
// Record 439345 was already corrected to St. Albans Grove (AT6155) via MCP on 2026-07-02.
// 536613 is byte-identical to 439345's OLD (wrong Baxter) state — the dup to remove.
// This script archives the full record to data/deleted-record-536613-restore.json FIRST,
// then deletes, then verifies it is gone.
//
// Run:  cd ~/Projects/filemaker-mcp && node scripts/delete-dup-536613.mjs
import { deleteRecord, getRecord } from '../src/fm-client.js';
import { writeFileSync } from 'node:fs';

const DB = 'WALLPAPER';
const LAYOUT = 'Basic List of Fields';
const REC = '536613';
const ARCHIVE = new URL('../data/deleted-record-536613-restore.json', import.meta.url).pathname;

const rec = await getRecord(DB, '*List Wallpapers - Shopify Detail Database', REC);
writeFileSync(ARCHIVE, JSON.stringify({ deletedAt_note: 'DWTA baxter dedup 2026-07-02', db: DB, recordId: REC, record: rec }, null, 2));
console.log('ARCHIVED →', ARCHIVE);

await deleteRecord(DB, LAYOUT, REC);
console.log('DELETED recordId', REC, 'from', DB);

try { await getRecord(DB, LAYOUT, REC); console.log('WARN: record still fetchable'); }
catch (e) { console.log('VERIFIED gone:', e.message); }