feat: 补齐消毒、种源与二维码身份链
This commit is contained in:
@@ -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{},
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user