Skip to content

Commit b305ba2

Browse files
committed
Shorter install engine
1 parent e2265bb commit b305ba2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

models/db/engine.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,10 @@ func syncTables() error {
128128
return x.StoreEngine("InnoDB").Sync2(tables...)
129129
}
130130

131-
// InitInstallTestEngineWithMigration creates a new xorm.Engine for testing during install
131+
// InitInstallEngineWithMigration creates a new xorm.Engine for testing during install
132132
//
133133
// This function will cause the basic database schema to be created
134-
func InitInstallTestEngineWithMigration(ctx context.Context, migrateFunc func(*xorm.Engine) error) (err error) {
134+
func InitInstallEngineWithMigration(ctx context.Context, migrateFunc func(*xorm.Engine) error) (err error) {
135135
x, err = NewEngine()
136136
if err != nil {
137137
return fmt.Errorf("failed to connect to database: %w", err)

routers/install/install.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ func SubmitInstall(ctx *context.Context) {
209209
}
210210

211211
// Set test engine.
212-
if err = db.InitInstallTestEngineWithMigration(ctx, migrations.Migrate); err != nil {
212+
if err = db.InitInstallEngineWithMigration(ctx, migrations.Migrate); err != nil {
213213
if strings.Contains(err.Error(), `Unknown database type: sqlite3`) {
214214
ctx.Data["Err_DbType"] = true
215215
ctx.RenderWithErr(ctx.Tr("install.sqlite3_not_available", "https://docs.gitea.io/en-us/install-from-binary/"), tplInstall, &form)

0 commit comments

Comments
 (0)