feat(server): de-duplication (#557)

* feat(server): remove un-used deviceAssetId cols.

* feat(server): return 409 if asset is duplicated

* feat(server): replace old unique constaint

* feat(server): strip deviceId in file path

* feat(server): skip duplicate asset

* chore(server): revert changes

* fix(server): asset test spec

* fix(server): checksum generation for uploaded assets

* fix(server): make sure generation queue run after migraion

* feat(server): remove temp file

* chore(server): remove dead code
This commit is contained in:
Thanh Pham
2022-09-06 02:45:38 +07:00
committed by GitHub
parent 2677ddccaa
commit a467936e73
9 changed files with 64 additions and 18 deletions

View File

@@ -3,7 +3,7 @@ import { ExifEntity } from './exif.entity';
import { SmartInfoEntity } from './smart-info.entity';
@Entity('assets')
@Unique(['deviceAssetId', 'userId', 'deviceId'])
@Unique('UQ_userid_checksum', ['userId', 'checksum'])
export class AssetEntity {
@PrimaryGeneratedColumn('uuid')
id!: string;