Add primary key and index to external login user table (#1656)

This commit is contained in:
Lauris BH 2017-05-02 11:41:44 +03:00 committed by Bo-Yi Wu
parent 87efc8c6d4
commit 98548c83d3
3 changed files with 43 additions and 3 deletions

View file

@ -8,9 +8,9 @@ import "github.com/markbates/goth"
// ExternalLoginUser makes the connecting between some existing user and additional external login sources
type ExternalLoginUser struct {
ExternalID string `xorm:"NOT NULL"`
UserID int64 `xorm:"NOT NULL"`
LoginSourceID int64 `xorm:"NOT NULL"`
ExternalID string `xorm:"pk NOT NULL"`
UserID int64 `xorm:"INDEX NOT NULL"`
LoginSourceID int64 `xorm:"pk NOT NULL"`
}
// GetExternalLogin checks if a externalID in loginSourceID scope already exists