初始提交: Gitea 项目代码
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
// Copyright 2022 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package v1_18
|
||||
|
||||
import "gitea.dev/models/db"
|
||||
|
||||
func CreateUserBadgesTable(x db.EngineMigration) error {
|
||||
type Badge struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
Description string
|
||||
ImageURL string
|
||||
}
|
||||
|
||||
type userBadge struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
BadgeID int64
|
||||
UserID int64 `xorm:"INDEX"`
|
||||
}
|
||||
|
||||
if err := x.Sync(new(Badge)); err != nil {
|
||||
return err
|
||||
}
|
||||
return x.Sync(new(userBadge))
|
||||
}
|
||||
Reference in New Issue
Block a user