23 lines
594 B
TypeScript
Executable File
23 lines
594 B
TypeScript
Executable File
import { Column, Entity, OneToMany } from "typeorm";
|
|
|
|
import { Blog } from "./blog.entity";
|
|
import { BaseEntity } from "../../../common/entities/base.entity";
|
|
|
|
@Entity()
|
|
export class BlogCategory extends BaseEntity {
|
|
@Column({ type: "varchar", length: 100, unique: true })
|
|
title: string;
|
|
|
|
@Column({ type: "varchar", length: 255, nullable: true })
|
|
description: string;
|
|
|
|
@Column({ type: "varchar", length: 255, nullable: true })
|
|
iconUrl: string;
|
|
|
|
@Column({ type: "boolean", default: true })
|
|
isActive: boolean;
|
|
|
|
@OneToMany(() => Blog, (blog) => blog.category)
|
|
blogs: Blog[];
|
|
}
|