diff --git a/backend/src/album/album.entity.ts b/backend/src/album/album.entity.ts index 7e52bde..b3b9781 100644 --- a/backend/src/album/album.entity.ts +++ b/backend/src/album/album.entity.ts @@ -1,5 +1,5 @@ import { Entity, Column, OneToMany, PrimaryGeneratedColumn } from 'typeorm'; -import { IsNotEmpty, IsString } from 'class-validator'; +import { IsNotEmpty, IsString, IsOptional } from 'class-validator'; import { Song } from '../song/song.entity'; @Entity('album') @@ -22,6 +22,7 @@ export class Album { @IsNotEmpty() genre: string; + @IsOptional() @OneToMany(() => Song, (song) => song.album, { eager: true, onDelete: 'CASCADE',