Skip to content

Commit

Permalink
chore(zero-cache): remove unnecessary existence check (#3456)
Browse files Browse the repository at this point in the history
  • Loading branch information
darkgnotic authored Dec 27, 2024
1 parent fbb3426 commit b3d09da
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,10 @@ export async function setupTablesAndReplication(
allPublications.push(...publications);
} else {
const defaultPublication = DEFAULT_PUBLICATION_PREFIX + id;
const result = await tx`
SELECT 1 FROM pg_publication WHERE pubname = ${defaultPublication}`;
if (result.length === 0) {
await tx`
// Note: For re-syncing, this publication is dropped in dropShard(), so an existence
// check is unnecessary.
await tx`
CREATE PUBLICATION ${tx(defaultPublication)} FOR TABLES IN SCHEMA public`;
}
allPublications.push(defaultPublication);
}

Expand Down

0 comments on commit b3d09da

Please sign in to comment.