Skip to content

Commit 28925ad

Browse files
committed
Use False only for postgres
1 parent 3b0bd59 commit 28925ad

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

models/migrations/v219.go

+9-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"time"
1010

1111
"code.gitea.io/gitea/models/repo"
12+
"code.gitea.io/gitea/modules/setting"
1213
"code.gitea.io/gitea/modules/timeutil"
1314
"xorm.io/xorm"
1415
)
@@ -37,8 +38,14 @@ func addSyncOnPushColForPushMirror(x *xorm.Engine) error {
3738
return fmt.Errorf("sync2: %v", err)
3839
}
3940

40-
if _, err := session.Exec("UPDATE push_mirror SET sync_on_commit = FALSE"); err != nil {
41-
return err
41+
if setting.Database.UsePostgreSQL { // PostgreSQL uses Boolean type
42+
if _, err := session.Exec("UPDATE push_mirror SET sync_on_commit = FALSE"); err != nil {
43+
return err
44+
}
45+
} else {
46+
if _, err := session.Exec("UPDATE push_mirror SET sync_on_commit = 0"); err != nil {
47+
return err
48+
}
4249
}
4350

4451
return session.Commit()

0 commit comments

Comments
 (0)