fix joincolumn as primary key

This commit is contained in:
mgabor
2024-04-17 09:51:51 +02:00
parent 87bc244b68
commit 2154ab04e0
2 changed files with 15 additions and 3 deletions
+6 -2
View File
@@ -12,12 +12,16 @@ export enum AlbumUserRole {
@Index('IDX_427c350ad49bd3935a50baab73', ['album'])
@Index('IDX_f48513bf9bccefd6ff3ad30bd0', ['user'])
export class AlbumUserEntity {
@PrimaryColumn({ type: 'uuid', name: 'albumsId' })
@PrimaryColumn({ type: 'uuid' })
albumsId!: string;
@PrimaryColumn({ type: 'uuid' })
usersId!: string;
@JoinColumn({ name: 'albumsId' })
@ManyToOne(() => AlbumEntity, { onDelete: 'CASCADE', onUpdate: 'CASCADE', nullable: false })
album!: AlbumEntity;
@PrimaryColumn({ type: 'uuid', name: 'usersId' })
@JoinColumn({ name: 'usersId' })
@ManyToOne(() => UserEntity, { onDelete: 'CASCADE', onUpdate: 'CASCADE', nullable: false })
user!: UserEntity;