|
|
|
@@ -204,7 +204,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 { |
|
|
|
@@ -213,7 +212,7 @@ func SetEngine() (err error) { |
|
|
|
if err = setEngine(xStatistic, tablesStatistic, setting.DatabaseStatistic); err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
|
MigrateCustomStatic(xStatistic) |
|
|
|
|
|
|
|
return nil |
|
|
|
} |
|
|
|
|
|
|
|
@@ -225,7 +224,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) |
|
|
|
@@ -233,6 +232,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 |
|
|
|
|
|
|
|
|