mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-15 10:55:49 +00:00
c3b2e44392
Allows to add (not registered) team members by email. related #5353 Invite by mail: ![grafik](https://user-images.githubusercontent.com/1666336/178154779-adcc547f-c0b7-4a2a-a131-4e41a3d9d3ad.png) Pending invitations: ![grafik](https://user-images.githubusercontent.com/1666336/178154882-9d739bb8-2b04-46c1-a025-c1f4be26af98.png) Email: ![grafik](https://user-images.githubusercontent.com/1666336/178164716-f2f90893-7ba6-4a5e-a3db-42538a660258.png) Join form: ![grafik](https://user-images.githubusercontent.com/1666336/178154840-aaab983a-d922-4414-b01a-9b1a19c5cef7.png) Co-authored-by: Jack Hay <jjphay@gmail.com>
27 lines
906 B
Go
27 lines
906 B
Go
// Copyright 2022 The Gitea Authors. All rights reserved.
|
|
// Use of this source code is governed by a MIT-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package migrations
|
|
|
|
import (
|
|
"code.gitea.io/gitea/modules/timeutil"
|
|
|
|
"xorm.io/xorm"
|
|
)
|
|
|
|
func addTeamInviteTable(x *xorm.Engine) error {
|
|
type TeamInvite struct {
|
|
ID int64 `xorm:"pk autoincr"`
|
|
Token string `xorm:"UNIQUE(token) INDEX NOT NULL DEFAULT ''"`
|
|
InviterID int64 `xorm:"NOT NULL DEFAULT 0"`
|
|
OrgID int64 `xorm:"INDEX NOT NULL DEFAULT 0"`
|
|
TeamID int64 `xorm:"UNIQUE(team_mail) INDEX NOT NULL DEFAULT 0"`
|
|
Email string `xorm:"UNIQUE(team_mail) NOT NULL DEFAULT ''"`
|
|
CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
|
|
UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"`
|
|
}
|
|
|
|
return x.Sync2(new(TeamInvite))
|
|
}
|