Skip to content

Commit a9c7a23

Browse files
committed
Update models/migrations/v167.go
1 parent d339e41 commit a9c7a23

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

models/migrations/v167.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ import (
1111
)
1212

1313
func recreateUserTableToFixDefaultValues(x *xorm.Engine) error {
14+
if _, err := x.Where(builder.IsNull{"keep_activity_private"}).
15+
Cols("keep_activity_private").
16+
Update(User{KeepActivityPrivate: false}); err != nil {
17+
return err
18+
}
19+
1420
switch x.Dialect().URI().DBType {
1521
case schemas.MYSQL:
1622
_, err := x.Exec("ALTER TABLE `user` MODIFY COLUMN keep_activity_private tinyint(1) DEFAULT 0 NOT NULL;")

0 commit comments

Comments
 (0)