feat: 补齐消毒、种源与二维码身份链

This commit is contained in:
weijuesen
2026-08-14 08:39:56 +08:00
parent cc93c9a053
commit 6b222abb7b
24 changed files with 1344 additions and 9 deletions
+3
View File
@@ -41,6 +41,9 @@ func Init(cfg *config.Config) error {
&model.DetectionTask{},
&model.Sample{},
&model.DiseaseEvent{},
&model.SeedSource{},
&model.DisinfectionRecord{},
&model.IdentityLink{},
&model.Tray{}, &model.Batch{}, &model.RearingRecord{},
&model.WechatBinding{},
&model.WeatherAlert{},
+1 -1
View File
@@ -13,7 +13,7 @@ import (
)
// CurrentSchemaVersion 是当前后端代码期望的迁移版本。
const CurrentSchemaVersion = "5"
const CurrentSchemaVersion = "6"
// RunMigrations 使用嵌入式 SQL 迁移文件将数据库升级到最新版本。
func RunMigrations(db *gorm.DB) error {
@@ -112,4 +112,8 @@ func TestEmbeddedMigrationsIncludeBaseline(t *testing.T) {
if err != nil || next != 5 {
t.Fatalf("expected detection/disease migration version 5, got %d (err %v)", next, err)
}
next, err = driver.Next(next)
if err != nil || next != 6 {
t.Fatalf("expected biosecurity migration version 6, got %d (err %v)", next, err)
}
}