summaryrefslogtreecommitdiffstats
path: root/models/migrations/v1_14/v167.go
blob: 9d416f6a32d476159d34757224f4920642dfe95f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright 2021 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT

package v1_14 //nolint

import (
	"fmt"

	"xorm.io/xorm"
)

func AddUserRedirect(x *xorm.Engine) (err error) {
	type UserRedirect struct {
		ID             int64  `xorm:"pk autoincr"`
		LowerName      string `xorm:"UNIQUE(s) INDEX NOT NULL"`
		RedirectUserID int64
	}

	if err := x.Sync(new(UserRedirect)); err != nil {
		return fmt.Errorf("Sync: %w", err)
	}
	return nil
}