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

package v1_22 //nolint

import (
	"code.gitea.io/gitea/modules/timeutil"

	"xorm.io/xorm"
)

type Blocking struct {
	ID          int64 `xorm:"pk autoincr"`
	BlockerID   int64 `xorm:"UNIQUE(block)"`
	BlockeeID   int64 `xorm:"UNIQUE(block)"`
	Note        string
	CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
}

func (*Blocking) TableName() string {
	return "user_blocking"
}

func AddUserBlockingTable(x *xorm.Engine) error {
	return x.Sync(&Blocking{})
}