From 765e220b30be411a6e74f8a83bcd75d0dc595724 Mon Sep 17 00:00:00 2001 From: guo <1716967236@qq.com> Date: Sat, 28 Jun 2025 21:08:33 +0800 Subject: [PATCH] =?UTF-8?q?[xingyu.guo]=20feat:=201.=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E5=88=A0=E9=99=A4=E7=AC=A6=202.=20=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E5=AD=97=E6=AE=B5=E2=80=9C=E5=AD=A6=E4=B9=A0=E6=9D=90?= =?UTF-8?q?=E6=96=99=E7=9A=84=E5=AD=98=E5=82=A8URL=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/BaseEntity.java | 4 +++ .../V20250608_1__removeMaterialUrlNotNull.sql | 2 ++ .../migration/V20250628_1__addTableLogic.sql | 27 +++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 src/main/resources/db/migration/V20250608_1__removeMaterialUrlNotNull.sql create mode 100644 src/main/resources/db/migration/V20250628_1__addTableLogic.sql 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 '逻辑删除符'; +