2020-07-11 19:35:31 +02:00
|
|
|
import { Column, Entity, ManyToMany, PrimaryGeneratedColumn } from "typeorm";
|
2020-09-05 21:07:05 +02:00
|
|
|
import { SpotifyLibraryDetails } from "../sources/spotify/spotify-library-details.entity";
|
2020-02-02 19:21:58 +01:00
|
|
|
import { Album } from "./album.entity";
|
|
|
|
|
|
|
|
|
|
@Entity()
|
|
|
|
|
export class Artist {
|
|
|
|
|
@PrimaryGeneratedColumn("uuid")
|
|
|
|
|
id: string;
|
|
|
|
|
|
|
|
|
|
@Column()
|
|
|
|
|
name: string;
|
|
|
|
|
|
2020-05-02 17:17:20 +02:00
|
|
|
@ManyToMany((type) => Album, (album) => album.artists)
|
2020-07-11 19:35:31 +02:00
|
|
|
albums?: Album[];
|
2020-02-02 19:21:58 +01:00
|
|
|
|
2020-05-02 17:17:20 +02:00
|
|
|
@Column((type) => SpotifyLibraryDetails)
|
2020-02-02 19:21:58 +01:00
|
|
|
spotify: SpotifyLibraryDetails;
|
|
|
|
|
}
|