mirror of
https://github.com/go-gitea/gitea
synced 2024-06-29 16:26:55 +02:00
corrected migration
This commit is contained in:
parent
3185021110
commit
5e69859af0
|
@ -15,6 +15,10 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func AddActionsVisibility(x *xorm.Engine) error {
|
func AddActionsVisibility(x *xorm.Engine) error {
|
||||||
|
type User struct {
|
||||||
|
ActionsVisibility structs.ActionsVisibility `xorm:"NOT NULL DEFAULT 0"`
|
||||||
|
}
|
||||||
|
|
||||||
// This migration maybe rerun so that we should check if it has been run
|
// This migration maybe rerun so that we should check if it has been run
|
||||||
hasActionsVisibility, err := x.Dialect().IsColumnExist(x.DB(), context.Background(), "user", "actions_visibility")
|
hasActionsVisibility, err := x.Dialect().IsColumnExist(x.DB(), context.Background(), "user", "actions_visibility")
|
||||||
if err != nil || hasActionsVisibility {
|
if err != nil || hasActionsVisibility {
|
||||||
|
@ -28,11 +32,7 @@ func AddActionsVisibility(x *xorm.Engine) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
type User struct {
|
if err = sess.Sync(&User{}); err != nil {
|
||||||
ActionsVisibility structs.ActionsVisibility `xorm:"NOT NULL DEFAULT 0"`
|
|
||||||
}
|
|
||||||
|
|
||||||
if err = x.Sync(&User{}); err != nil {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user