|
|
@@ -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 |
|
|
|
|
|
|
|