Skip to content

Commit

Permalink
⚡️ create database index for videobasicinfo (#1391)
Browse files Browse the repository at this point in the history
  • Loading branch information
moisout committed Apr 29, 2022
1 parent 72b0873 commit b9ef2ca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/core/videos/schemas/video-basic-info.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class VideoBasicInfo extends Document implements VideoBasicInfoDto {
@Prop()
author: string;

@Prop()
@Prop({ index: true })
authorId: string;

@Prop()
Expand Down
2 changes: 1 addition & 1 deletion server/user/schemas/user.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
// eslint-disable-next-line no-undef
@Schema({ timestamps: true })
export class User extends Document {
@Prop()
@Prop({ index: { unique: true } })
username: string;

@Prop()
Expand Down

0 comments on commit b9ef2ca

Please sign in to comment.