mirror of
https://github.com/immich-app/immich.git
synced 2024-12-25 10:43:13 +02: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:
parent
6f7071b12d
commit
db628cec11
@ -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[];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user