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

package v1_21 //nolint

import (
	"xorm.io/xorm"
)

func AddIndexToActionUserID(x *xorm.Engine) error {
	type Action struct {
		UserID int64 `xorm:"INDEX"`
	}

	_, err := x.SyncWithOptions(xorm.SyncOptions{
		IgnoreDropIndices: true,
		IgnoreConstrains:  true,
	}, new(Action))
	return err
}