You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
539 B
Go
25 lines
539 B
Go
4 years ago
|
// Copyright 2021 The Gitea Authors. All rights reserved.
|
||
|
// Use of this source code is governed by a MIT-style
|
||
|
// license that can be found in the LICENSE file.
|
||
|
|
||
2 years ago
|
package v1_14 //nolint
|
||
4 years ago
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
|
||
|
"xorm.io/xorm"
|
||
|
)
|
||
|
|
||
2 years ago
|
func AddUserRedirect(x *xorm.Engine) (err error) {
|
||
4 years ago
|
type UserRedirect struct {
|
||
|
ID int64 `xorm:"pk autoincr"`
|
||
|
LowerName string `xorm:"UNIQUE(s) INDEX NOT NULL"`
|
||
|
RedirectUserID int64
|
||
|
}
|
||
|
|
||
|
if err := x.Sync2(new(UserRedirect)); err != nil {
|
||
2 years ago
|
return fmt.Errorf("Sync2: %w", err)
|
||
4 years ago
|
}
|
||
|
return nil
|
||
|
}
|