调整数据库结构、添加博客权限enum

This commit is contained in:
2025-06-22 23:25:38 +08:00
parent 063181da5a
commit 5ae62d5d22
3 changed files with 17 additions and 1 deletions

View File

@@ -8,6 +8,7 @@ import {
UpdateDateColumn,
} from 'typeorm';
import { BlogComment } from './BlogComment.entity';
import { BlogPermission } from '../Blog.Permission.enum';
@Entity()
export class Blog {
@@ -35,7 +36,12 @@ export class Blog {
@DeleteDateColumn({ precision: 3, nullable: true })
deletedAt: Date;
// 权限关系 TODO
// 权限
@Column('simple-array', { default: '' })
permissions: BlogPermission[];
@Column({ nullable: true })
password_hash: string | null;
// 关系
@OneToMany(() => BlogComment, (blog) => blog.id)