mirror of
https://github.com/immich-app/immich.git
synced 2025-07-09 09:12:57 +02:00
* fix(server,mobile): proper asset sync * fix CI issues * only use id instead of createdAt+id * remove createdAt index * fix typo * cleanup createdAt usage --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
21 lines
583 B
TypeScript
21 lines
583 B
TypeScript
import { AssetEntity } from 'src/entities/asset.entity';
|
|
import { Column, Entity, JoinColumn, OneToMany, OneToOne, PrimaryGeneratedColumn } from 'typeorm';
|
|
|
|
@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;
|
|
|
|
assetCount?: number;
|
|
}
|