refactor(server): rename asset stack to stack (#10828)

This commit is contained in:
Jason Rasmussen 2024-07-05 09:08:36 -04:00 committed by GitHub
parent 23b3073687
commit eb1ba11d60
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 68 additions and 70 deletions

View file

@ -0,0 +1,21 @@
import { AssetEntity } from 'src/entities/asset.entity';
import { Column, Entity, JoinColumn, OneToMany, OneToOne, PrimaryGeneratedColumn } from 'typeorm';
@Entity('asset_stack')
export class StackEntity {
@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;
}