diff --git a/internal/db/migrations/00021_add_meta_column_to_users_table.sql b/internal/db/migrations/00021_add_meta_column_to_users_table.sql new file mode 100644 index 0000000..8600d8d --- /dev/null +++ b/internal/db/migrations/00021_add_meta_column_to_users_table.sql @@ -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 diff --git a/internal/model/user.go b/internal/model/user.go index a823efd..bce16e2 100644 --- a/internal/model/user.go +++ b/internal/model/user.go @@ -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 {