feat: update user model

This commit is contained in:
juancwu 2026-04-03 17:53:12 +00:00
commit 0e70b70242
2 changed files with 14 additions and 4 deletions

View file

@ -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

View file

@ -6,10 +6,11 @@ type User struct {
ID string `db:"id"`
Email string `db:"email"`
// Allow null for passwordless users
PasswordHash *string `db:"password_hash"`
PendingEmail *string `db:"pending_email"`
EmailVerifiedAt *time.Time `db:"email_verified_at"`
CreatedAt time.Time `db:"created_at"`
PasswordHash *string `db:"password_hash"`
PendingEmail *string `db:"pending_email"`
EmailVerifiedAt *time.Time `db:"email_verified_at"`
CreatedAt time.Time `db:"created_at"`
Meta *map[string]any `db:"meta"`
}
func (u *User) HasPassword() bool {