Bläddra i källkod

♻️ refactor(database): 统一布尔类型字段数据库类型

- 将consultation模块的is_guest字段从tinyint改为smallint
- 将membership模块的is_active字段从tinyint改为smallint
- 将solution-designs模块的is_deleted字段从tinyint改为smallint
- 将templates模块的is_free、is_disabled和is_deleted字段从tinyint改为smallint
- 保持字段功能和默认值不变,提高数据库类型一致性
yourname 1 månad sedan
förälder
incheckning
78599c2082

+ 1 - 1
src/server/modules/consultation/consultation-request.entity.ts

@@ -32,7 +32,7 @@ export class ConsultationRequest {
   @Column({ name: 'status', type: 'varchar', length: 20, default: 'pending', comment: '状态:pending-待处理, processing-处理中, completed-已完成' })
   status!: string;
 
-  @Column({ name: 'is_guest', type: 'tinyint', default: 0, comment: '是否为游客提交' })
+  @Column({ name: 'is_guest', type: 'smallint', default: 0, comment: '是否为游客提交' })
   isGuest!: number;
 
   @Column({ name: 'ip_address', type: 'varchar', length: 45, nullable: true, comment: '提交IP地址' })

+ 1 - 1
src/server/modules/membership/membership-plan.entity.ts

@@ -29,7 +29,7 @@ export class MembershipPlan {
   @Column({ name: 'features', type: 'json', comment: '套餐功能列表' })
   features!: string[];
 
-  @Column({ name: 'is_active', type: 'tinyint', default: 1, comment: '是否启用' })
+  @Column({ name: 'is_active', type: 'smallint', default: 1, comment: '是否启用' })
   isActive!: number;
 
   @Column({ name: 'sort_order', type: 'int', default: 0, comment: '排序' })

+ 1 - 1
src/server/modules/solution-designs/solution-chapter.entity.ts

@@ -45,7 +45,7 @@ export class SolutionChapter {
   @Column({ name: 'version', type: 'int', default: 1, comment: '版本号' })
   version!: number;
 
-  @Column({ name: 'is_deleted', type: 'tinyint', default: 0, comment: '是否删除:0-未删除,1-已删除' })
+  @Column({ name: 'is_deleted', type: 'smallint', default: 0, comment: '是否删除:0-未删除,1-已删除' })
   isDeleted!: number;
 
   @CreateDateColumn({ name: 'created_at', comment: '创建时间' })

+ 1 - 1
src/server/modules/solution-designs/solution-design.entity.ts

@@ -53,7 +53,7 @@ export class SolutionDesign {
   @Column({ name: 'completed_chapters', type: 'int', default: 0, comment: '已完成章节数' })
   completedChapters!: number;
 
-  @Column({ name: 'is_deleted', type: 'tinyint', default: 0, comment: '是否删除:0-未删除,1-已删除' })
+  @Column({ name: 'is_deleted', type: 'smallint', default: 0, comment: '是否删除:0-未删除,1-已删除' })
   isDeleted!: number;
 
   @CreateDateColumn({ name: 'created_at', comment: '创建时间' })

+ 3 - 3
src/server/modules/templates/template.entity.ts

@@ -22,16 +22,16 @@ export class Template {
   @Column({ name: 'category', type: 'varchar', length: 100, comment: '模板分类' })
   category!: string;
 
-  @Column({ name: 'is_free', type: 'tinyint', default: 0, comment: '是否免费:0-收费,1-免费' })
+  @Column({ name: 'is_free', type: 'smallint', default: 0, comment: '是否免费:0-收费,1-免费' })
   isFree!: number;
 
   @Column({ name: 'download_count', type: 'int', unsigned: true, default: 0, comment: '下载次数' })
   downloadCount!: number;
 
-  @Column({ name: 'is_disabled', type: 'tinyint', default: 0, comment: '是否禁用:0-启用,1-禁用' })
+  @Column({ name: 'is_disabled', type: 'smallint', default: 0, comment: '是否禁用:0-启用,1-禁用' })
   isDisabled!: number;
 
-  @Column({ name: 'is_deleted', type: 'tinyint', default: 0, comment: '是否删除:0-未删除,1-已删除' })
+  @Column({ name: 'is_deleted', type: 'smallint', default: 0, comment: '是否删除:0-未删除,1-已删除' })
   isDeleted!: number;
 
   @Column({ name: 'preview_url', type: 'varchar', length: 500, nullable: true, comment: '预览URL' })