Files
dsc-api/src/modules/blogs/entities/blog-category.entity.ts
T
2025-04-23 14:59:20 +03:30

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[];
}