diff --git a/src/main/java/com/guo/learningprogresstracker/entity/BaseEntity.java b/src/main/java/com/guo/learningprogresstracker/entity/BaseEntity.java index 6c043e3..a8c0b2e 100644 --- a/src/main/java/com/guo/learningprogresstracker/entity/BaseEntity.java +++ b/src/main/java/com/guo/learningprogresstracker/entity/BaseEntity.java @@ -2,6 +2,7 @@ package com.guo.learningprogresstracker.entity; import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableLogic; import lombok.Data; import java.time.LocalDateTime; @@ -26,4 +27,7 @@ public class BaseEntity { @TableField(fill = FieldFill.INSERT_UPDATE) private String deviceInfo; + + @TableLogic + private Integer deleted; } diff --git a/src/main/resources/db/migration/V20250608_1__removeMaterialUrlNotNull.sql b/src/main/resources/db/migration/V20250608_1__removeMaterialUrlNotNull.sql new file mode 100644 index 0000000..9f2df19 --- /dev/null +++ b/src/main/resources/db/migration/V20250608_1__removeMaterialUrlNotNull.sql @@ -0,0 +1,2 @@ +alter table tasks + modify material_url varchar(255) null comment '学习材料的存储URL' COMMENT '上次该任务学习情况' after calculated_priority; \ No newline at end of file diff --git a/src/main/resources/db/migration/V20250628_1__addTableLogic.sql b/src/main/resources/db/migration/V20250628_1__addTableLogic.sql new file mode 100644 index 0000000..2d69a92 --- /dev/null +++ b/src/main/resources/db/migration/V20250628_1__addTableLogic.sql @@ -0,0 +1,27 @@ +alter table flyway_schema_history + add deleted int default 0 not null comment '逻辑删除符'; + +alter table study_expectations + add deleted int default 0 not null comment '逻辑删除符'; + +alter table study_report_fragments + add deleted int default 0 not null comment '逻辑删除符'; + +alter table study_reports + add deleted int default 0 not null comment '逻辑删除符'; + +alter table study_sessions + add deleted int default 0 not null comment '逻辑删除符'; + +alter table tasks + add deleted int default 0 not null comment '逻辑删除符'; + +alter table test_table + add deleted int default 0 not null comment '逻辑删除符'; + +alter table user + add deleted int default 0 not null comment '逻辑删除符'; + +alter table user_task + add deleted int default 0 not null comment '逻辑删除符'; +