Skip to content

Commit

Permalink
fix(database): add cnd_ prefix check (#570)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisPdgn committed Mar 24, 2023
1 parent a1c54d4 commit 641bcb6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions modules/database/src/adapters/DatabaseAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,11 @@ export abstract class DatabaseAdapter<T extends Schema> {
name: schema.name,
});
if (!declaredSchema) {
collectionName = collectionName.startsWith('_')
? `cnd${collectionName}`
: `cnd_${collectionName}`;
if (!collectionName.startsWith('cnd_')) {
collectionName = collectionName.startsWith('_')
? `cnd${collectionName}`
: `cnd_${collectionName}`;
}
} else {
// recover collection name from DeclaredSchema
collectionName = declaredSchema.collectionName;
Expand Down

0 comments on commit 641bcb6

Please sign in to comment.