do not allow uploading same photo twice

This commit is contained in:
2020-10-14 21:07:53 +03:00
committed by Stepan Usatiuk
parent c20642dba4
commit 6e7c6ae566
2 changed files with 35 additions and 1 deletions

View File

@@ -43,6 +43,7 @@ export interface IPhotoReqJSON extends IPhotoJSON {
}
@Entity()
@Index(["hash", "size", "user"], { unique: true })
export class Photo extends BaseEntity {
@PrimaryGeneratedColumn()
public id: number;