mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-09 10:13:42 +08:00
fix: only master node can migrate database
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user