Skip to content

Commit

Permalink
typebox diff fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
wernst committed Dec 5, 2024
1 parent 4ccc642 commit 8fd9b4c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/db/src/schema/diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,17 @@ export function diffSchemas(
}))
);
// Diff rules
const isRuleDiff = Diff(collectionA?.rules, collectionB?.rules).length > 0;
const isRuleDiff =
!!collectionA?.rules !== !!collectionB?.rules ||
Diff(collectionA?.rules, collectionB?.rules).length > 0;
if (isRuleDiff)
diff.push({
_diff: 'collectionRules',
collection,
});
// Diff permissions
const isPermissionDiff =
!!collectionA?.permissions !== !!collectionB?.permissions ||
Diff(collectionA?.permissions, collectionB?.permissions).length > 0;
if (isPermissionDiff)
diff.push({
Expand All @@ -235,7 +238,9 @@ export function diffSchemas(
}

// Diff roles
const isRoleDiff = Diff(schemaA.roles, schemaB.roles).length > 0;
const isRoleDiff =
!!schemaA.roles !== !!schemaB.roles ||
Diff(schemaA.roles, schemaB.roles).length > 0;
if (isRoleDiff)
diff.push({
_diff: 'roles',
Expand Down

0 comments on commit 8fd9b4c

Please sign in to comment.