mirror of
https://github.com/Art051/immich.git
synced 2025-08-11 19:29:00 +00:00
refactor: move asset stacks to their own entity (#6353)
* feat: auto-stack burst photos * feat: move stacks to asset stack entity * chore: pin node version with volta in server * chore: update e2e cases * chore: cleanup * feat: migrate existing stacks --------- Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This commit is contained in:
19
server/src/infra/entities/asset-stack.entity.ts
Normal file
19
server/src/infra/entities/asset-stack.entity.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { Column, Entity, JoinColumn, OneToMany, OneToOne, PrimaryGeneratedColumn } from 'typeorm';
|
||||
import { AssetEntity } from './asset.entity';
|
||||
|
||||
@Entity('asset_stack')
|
||||
export class AssetStackEntity {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id!: string;
|
||||
|
||||
@OneToMany(() => AssetEntity, (asset) => asset.stack)
|
||||
assets!: AssetEntity[];
|
||||
|
||||
@OneToOne(() => AssetEntity)
|
||||
@JoinColumn()
|
||||
//TODO: Add constraint to ensure primary asset exists in the assets array
|
||||
primaryAsset!: AssetEntity;
|
||||
|
||||
@Column({ nullable: false })
|
||||
primaryAssetId!: string;
|
||||
}
|
||||
Reference in New Issue
Block a user