feat: update user model
This commit is contained in:
parent
11ca2188e4
commit
0e70b70242
2 changed files with 14 additions and 4 deletions
|
|
@ -0,0 +1,9 @@
|
||||||
|
-- +goose Up
|
||||||
|
-- +goose StatementBegin
|
||||||
|
ALTER TABLE users ADD COLUMN meta JSONB;
|
||||||
|
-- +goose StatementEnd
|
||||||
|
|
||||||
|
-- +goose Down
|
||||||
|
-- +goose StatementBegin
|
||||||
|
ALTER TABLE users DROP COLUMN meta;
|
||||||
|
-- +goose StatementEnd
|
||||||
|
|
@ -6,10 +6,11 @@ type User struct {
|
||||||
ID string `db:"id"`
|
ID string `db:"id"`
|
||||||
Email string `db:"email"`
|
Email string `db:"email"`
|
||||||
// Allow null for passwordless users
|
// Allow null for passwordless users
|
||||||
PasswordHash *string `db:"password_hash"`
|
PasswordHash *string `db:"password_hash"`
|
||||||
PendingEmail *string `db:"pending_email"`
|
PendingEmail *string `db:"pending_email"`
|
||||||
EmailVerifiedAt *time.Time `db:"email_verified_at"`
|
EmailVerifiedAt *time.Time `db:"email_verified_at"`
|
||||||
CreatedAt time.Time `db:"created_at"`
|
CreatedAt time.Time `db:"created_at"`
|
||||||
|
Meta *map[string]any `db:"meta"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *User) HasPassword() bool {
|
func (u *User) HasPassword() bool {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue