mirror of
				https://github.com/KevinMidboe/immich.git
				synced 2025-10-29 17:40:28 +00:00 
			
		
		
		
	fix(server): cannot delete an asset if presented in album (#2223)
* fix(server): cannot delete an asset if presented in album * added migration * preserve correct migration
This commit is contained in:
		| @@ -43,7 +43,7 @@ export class AlbumEntity { | ||||
|   @JoinTable() | ||||
|   sharedUsers!: UserEntity[]; | ||||
|  | ||||
|   @ManyToMany(() => AssetEntity) | ||||
|   @ManyToMany(() => AssetEntity, (asset) => asset.albums) | ||||
|   @JoinTable() | ||||
|   assets!: AssetEntity[]; | ||||
|  | ||||
|   | ||||
| @@ -101,7 +101,7 @@ export class AssetEntity { | ||||
|   @JoinTable({ name: 'shared_link__asset' }) | ||||
|   sharedLinks!: SharedLinkEntity[]; | ||||
|  | ||||
|   @ManyToMany(() => AlbumEntity, (album) => album.assets) | ||||
|   @ManyToMany(() => AlbumEntity, (album) => album.assets, { onDelete: 'CASCADE', onUpdate: 'CASCADE' }) | ||||
|   albums?: AlbumEntity[]; | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user