import { Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import { RadioStationSubGenreEntity } from './radio-station-sub-genre.entity';

@Entity('radio_stations')
export class RadioStationEntity {
    @PrimaryGeneratedColumn() id: number;
    @Column({ type: 'varchar', length: 64 }) name: string;
    @Column({ type: 'varchar', length: 256 }) url: string;
    @Column() sub_genre_id: number;

    @ManyToOne(() => RadioStationSubGenreEntity, (parent) => parent.stations)
    @JoinColumn({ name: 'sub_genre_id' })
    parent: RadioStationSubGenreEntity;
}
