summaryrefslogtreecommitdiff
path: root/internal/gtsmodel/user.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2021-08-20 12:26:56 +0200
committerLibravatar GitHub <noreply@github.com>2021-08-20 12:26:56 +0200
commit4920229a3b6e1d7dde536bc9ff766542b05d935c (patch)
treea9423beccec5331c372f01eedf38949dfb171e9e /internal/gtsmodel/user.go
parentText/status parsing fixes (#141) (diff)
downloadgotosocial-4920229a3b6e1d7dde536bc9ff766542b05d935c.tar.xz
Database updates (#144)
* start moving some database stuff around * continue moving db stuff around * more fiddling * more updates * and some more * and yet more * i broke SOMETHING but what, it's a mystery * tidy up * vendor ttlcache * use ttlcache * fix up some tests * rename some stuff * little reminder * some more updates
Diffstat (limited to 'internal/gtsmodel/user.go')
-rw-r--r--internal/gtsmodel/user.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/gtsmodel/user.go b/internal/gtsmodel/user.go
index a1e912e99..fe8ebcabe 100644
--- a/internal/gtsmodel/user.go
+++ b/internal/gtsmodel/user.go
@@ -35,7 +35,8 @@ type User struct {
// 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 `pg:"default:null,unique"`
// The id of the local gtsmodel.Account entry for this user, if it exists (unconfirmed users don't have an account yet)
- AccountID string `pg:"type:CHAR(26),unique"`
+ AccountID string `pg:"type:CHAR(26),unique"`
+ Account *Account `pg:"rel:has-one"`
// 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
EncryptedPassword string `pg:",notnull"`
@@ -68,7 +69,8 @@ type User struct {
// In what timezone/locale is this user located?
Locale string
// Which application id created this user? See gtsmodel.Application
- CreatedByApplicationID string `pg:"type:CHAR(26)"`
+ CreatedByApplicationID string `pg:"type:CHAR(26)"`
+ CreatedByApplication *Application `pg:"rel:has-one"`
// When did we last contact this user
LastEmailedAt time.Time `pg:"type:timestamp"`