From dc2e1bf9aba9b52b6de979aadb1a0efcbd07f088 Mon Sep 17 00:00:00 2001 From: tsmethurst Date: Mon, 30 Aug 2021 13:38:06 +0200 Subject: more work on struct validation --- internal/gtsmodel/user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'internal/gtsmodel/user.go') diff --git a/internal/gtsmodel/user.go b/internal/gtsmodel/user.go index 27089763d..4e7c4638a 100644 --- a/internal/gtsmodel/user.go +++ b/internal/gtsmodel/user.go @@ -29,7 +29,7 @@ type User struct { ID string `validate:"required,ulid" bun:"type:CHAR(26),pk,nullzero,notnull,unique"` // id of this item in the database CreatedAt time.Time `validate:"required" bun:",nullzero,notnull,default:current_timestamp"` // when was item created UpdatedAt time.Time `validate:"required" bun:",nullzero,notnull,default:current_timestamp"` // when was item last updated - Email string `validate:"required_with=ConfirmedAt" bun:",nullzero,notnull,unique"` // confirmed email address for this user, this should be unique -- only one email address registered per instance, multiple users per email are not supported + Email string `validate:"required_with=ConfirmedAt" bun:",nullzero,unique"` // confirmed email address for this user, this should be unique -- only one email address registered per instance, multiple users per email are not supported AccountID string `validate:"required,ulid" bun:"type:CHAR(26),nullzero,notnull,unique"` // The id of the local gtsmodel.Account entry for this user. Account *Account `validate:"-" bun:"rel:belongs-to"` // Pointer to the account of this user that corresponds to AccountID. EncryptedPassword string `validate:"required" bun:",nullzero,notnull"` // The encrypted password of this user, generated using https://pkg.go.dev/golang.org/x/crypto/bcrypt#GenerateFromPassword. A salt is included so we're safe against 🌈 tables. -- cgit v1.2.3