feat: 建立可靠通知、吊销与跨实例状态
This commit is contained in:
@@ -36,6 +36,8 @@ func Init(cfg *config.Config) error {
|
||||
&model.Permission{}, &model.RolePermission{},
|
||||
&model.Disease{}, &model.KnowledgeArticle{},
|
||||
&model.InspectionRecord{},
|
||||
&model.OutboxEvent{},
|
||||
&model.Notification{},
|
||||
&model.Tray{}, &model.Batch{}, &model.RearingRecord{},
|
||||
&model.WechatBinding{},
|
||||
&model.WeatherAlert{},
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
)
|
||||
|
||||
// CurrentSchemaVersion 是当前后端代码期望的迁移版本。
|
||||
const CurrentSchemaVersion = "2"
|
||||
const CurrentSchemaVersion = "4"
|
||||
|
||||
// RunMigrations 使用嵌入式 SQL 迁移文件将数据库升级到最新版本。
|
||||
func RunMigrations(db *gorm.DB) error {
|
||||
|
||||
@@ -104,4 +104,8 @@ func TestEmbeddedMigrationsIncludeBaseline(t *testing.T) {
|
||||
if err != nil || next != 2 {
|
||||
t.Fatalf("expected risk assessment migration version 2, got %d (err %v)", next, err)
|
||||
}
|
||||
next, err = driver.Next(next)
|
||||
if err != nil || next != 4 {
|
||||
t.Fatalf("expected notifications/outbox migration version 4, got %d (err %v)", next, err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user