chore: add blog blog comment and blog category crud
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import { Column, DeleteDateColumn, 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[];
|
||||
|
||||
@DeleteDateColumn({ type: "timestamptz" })
|
||||
deletedAt?: Date;
|
||||
}
|
||||
Reference in New Issue
Block a user