修改训练计划模型中的id字段类型为UUID,并设置默认值为UUIDV4,以增强唯一性和安全性。

This commit is contained in:
richarjiang
2025-08-14 19:32:14 +08:00
parent 821e17ac7d
commit 366debf13a

View File

@@ -9,7 +9,10 @@ export type PlanGoal = 'postpartum_recovery' | 'fat_loss' | 'posture_correction'
}) })
export class TrainingPlan extends Model { export class TrainingPlan extends Model {
@PrimaryKey @PrimaryKey
@Column({ type: DataType.STRING }) @Column({
type: DataType.UUID,
defaultValue: DataType.UUIDV4,
})
declare id: string; declare id: string;
@Column({ type: DataType.STRING, allowNull: false }) @Column({ type: DataType.STRING, allowNull: false })