fix: only master node can migrate database

This commit is contained in:
JustSong committed 2023-06-22 00:52:27 +08:00
1 parent b90b8a9d8c
commit 64d026fc1a
2 files changed
+6

No files matched your search

+3
View File
@@ -55,6 +55,9 @@ func InitDB() (err error) {
}
if err == nil {
DB = db
if !common.IsMasterNode {
return nil
}
err := db.AutoMigrate(&Channel{})
if err != nil {
return err