mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-28 02:38:44 +09:00
94e3482d1a
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: wxiaoguang <2114189+wxiaoguang@users.noreply.github.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
26 lines
517 B
Go
26 lines
517 B
Go
// Copyright 2022 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package v1_18
|
|
|
|
import "code.gitea.io/gitea/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))
|
|
}
|