Skip to content

Commit

Permalink
fix: Rename MongoDB collections
Browse files Browse the repository at this point in the history
To drop the suffix `modelschemas`
  • Loading branch information
gnarea committed Sep 19, 2023
1 parent c1f3912 commit dc18e12
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/models/Member.model.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { index, prop, Severity } from '@typegoose/typegoose';
import { index, modelOptions, prop, Severity } from '@typegoose/typegoose';

export enum Role {
ORG_ADMIN = 'org_admin',
REGULAR = 'regular',
}

@modelOptions({ schemaOptions: { collection: 'members' } })
@index(
{ orgName: 1, name: 1 },
{ unique: true, partialFilterExpression: { name: { $type: 'string' } } },
Expand Down
3 changes: 2 additions & 1 deletion src/models/MemberBundleRequest.model.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { prop } from '@typegoose/typegoose';
import { modelOptions, prop } from '@typegoose/typegoose';

@modelOptions({ schemaOptions: { collection: 'member_bundle_requests' } })
export class MemberBundleRequestModelSchema {
@prop({ required: true, unique: true })
public publicKeyId!: string;
Expand Down
3 changes: 2 additions & 1 deletion src/models/MemberKeyImportToken.model.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { prop } from '@typegoose/typegoose';
import { modelOptions, prop } from '@typegoose/typegoose';

@modelOptions({ schemaOptions: { collection: 'member_key_import_tokens' } })
export class MemberKeyImportTokenModelSchema {
@prop({ required: true })
public memberId!: string;
Expand Down
2 changes: 2 additions & 0 deletions src/models/MemberPublicKey.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { prop, modelOptions } from '@typegoose/typegoose';

@modelOptions({
schemaOptions: {
collection: 'member_public_keys',

timestamps: {
createdAt: 'creationDate',
updatedAt: false,
Expand Down
3 changes: 2 additions & 1 deletion src/models/Org.model.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { prop } from '@typegoose/typegoose';
import { modelOptions, prop } from '@typegoose/typegoose';

@modelOptions({ schemaOptions: { collection: 'orgs' } })
export class OrgModelSchema {
@prop({ required: true, unique: true, index: true })
public name!: string;
Expand Down

0 comments on commit dc18e12

Please sign in to comment.