Skip to content

Commit

Permalink
reformat notion IDs into node IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
aubin-tchoi committed Jan 30, 2025
1 parent f54aa33 commit f86520a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions connectors/migrations/20250130_fix_notion_parents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,12 @@ async function updateParentsFieldForConnector(
return;
}

parents = parents.map((id) => `notion-${id}`);

let documentId: string | null = null;
let tableId: string | null = null;

if ("notionPageId" in node) {
// its a page
if (node.lastUpsertedTs) {
documentId = `notion-${node.notionPageId}`;
}
Expand All @@ -160,7 +161,6 @@ async function updateParentsFieldForConnector(
documentId,
parents,
parentId: parents[1] || null,
retries: 3,
});
}
if (tableId) {
Expand All @@ -169,7 +169,6 @@ async function updateParentsFieldForConnector(
tableId,
parents,
parentId: parents[1] || null,
retries: 3,
});
}
} catch (e) {
Expand Down

0 comments on commit f86520a

Please sign in to comment.