mirror of
https://github.com/go-gitea/gitea
synced 2024-06-17 10:30:35 +02:00
corrected migration
This commit is contained in:
parent
629562e287
commit
3185021110
|
@ -16,8 +16,8 @@ import (
|
|||
|
||||
func AddActionsVisibility(x *xorm.Engine) error {
|
||||
// This migration maybe rerun so that we should check if it has been run
|
||||
keepActivityPrivateExits, err := x.Dialect().IsColumnExist(x.DB(), context.Background(), "user", "keep_activity_private")
|
||||
if err != nil || !keepActivityPrivateExits {
|
||||
hasActionsVisibility, err := x.Dialect().IsColumnExist(x.DB(), context.Background(), "user", "actions_visibility")
|
||||
if err != nil || hasActionsVisibility {
|
||||
return err
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,14 @@ func AddActionsVisibility(x *xorm.Engine) error {
|
|||
return err
|
||||
}
|
||||
|
||||
type User struct {
|
||||
ActionsVisibility structs.ActionsVisibility `xorm:"NOT NULL DEFAULT 0"`
|
||||
}
|
||||
|
||||
if err = x.Sync(&User{}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, err := sess.
|
||||
Where(builder.Eq{"keep_activity_private": 1}).
|
||||
Cols("actions_visibility").
|
||||
|
|
Loading…
Reference in New Issue
Block a user