import {Entity, PrimaryGeneratedColumn, Column, OneToMany, OneToOne, ManyToOne} from "typeorm";
import { Course } from "./Course";

@Entity()
export class CourseCategory {

    @PrimaryGeneratedColumn()
    id!: number;

    @Column()
    name!: string;

    @Column({ type: 'text', nullable: true, default: null })
    description!: string;

    @Column({ default: true })
    enable!: boolean;

    @OneToMany(type => Course, Course => Course.CourseCategory)
    Courses!: Course[];
}