refactor(server): stack owner (#10900)

This commit is contained in:
Jason Rasmussen 2024-07-05 16:16:53 -04:00 committed by GitHub
parent f6cafa3290
commit e1f25b44d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 46 additions and 34 deletions

View file

@ -1,11 +1,18 @@
import { AssetEntity } from 'src/entities/asset.entity';
import { Column, Entity, JoinColumn, OneToMany, OneToOne, PrimaryGeneratedColumn } from 'typeorm';
import { UserEntity } from 'src/entities/user.entity';
import { Column, Entity, JoinColumn, ManyToOne, OneToMany, OneToOne, PrimaryGeneratedColumn } from 'typeorm';
@Entity('asset_stack')
export class StackEntity {
@PrimaryGeneratedColumn('uuid')
id!: string;
@ManyToOne(() => UserEntity, { onDelete: 'CASCADE', onUpdate: 'CASCADE' })
owner!: UserEntity;
@Column()
ownerId!: string;
@OneToMany(() => AssetEntity, (asset) => asset.stack)
assets!: AssetEntity[];