Browse Source

修改bug

tags/v1.21.12.1
ychao_1983 3 years ago
parent
commit
ba036592e8
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      models/models.go

+ 3
- 3
models/models.go View File

@@ -202,7 +202,6 @@ func SetEngine() (err error) {
if err = setEngine(x, tables, setting.Database); err != nil {
return err
}
MigrateCustom(x)

xStatistic, err = getEngine(setting.DatabaseStatistic)
if err != nil {
@@ -211,7 +210,7 @@ func SetEngine() (err error) {
if err = setEngine(xStatistic, tablesStatistic, setting.DatabaseStatistic); err != nil {
return err
}
MigrateCustomStatic(xStatistic)
return nil
}

@@ -223,7 +222,7 @@ func NewEngine(ctx context.Context, migrateFunc func(*xorm.Engine) error) (err e
if err = newEngine(ctx, migrateFunc, x, tables, setting.Database); err != nil {
return fmt.Errorf("newEngine failed: %v", err)
}
MigrateCustom(x)
xStatistic, err = getEngine(setting.DatabaseStatistic)
if err != nil {
return fmt.Errorf("Failed to connect to database: %v", err)
@@ -231,6 +230,7 @@ func NewEngine(ctx context.Context, migrateFunc func(*xorm.Engine) error) (err e
if err = newEngine(ctx, migrateFunc, xStatistic, tablesStatistic, setting.DatabaseStatistic); err != nil {
return fmt.Errorf("newEngine statistic failed: %v", err)
}
MigrateCustomStatic(xStatistic)

HasEngine = true



Loading…
Cancel
Save