From 39b2ea6bf7ab6143a73073cacb1132918fddc1cb Mon Sep 17 00:00:00 2001 From: Evan Reichard Date: Sun, 28 Jan 2024 22:17:58 -0500 Subject: [PATCH] fix(settings): auth hash accidentally overridden --- database/models.go | 2 +- database/query.sql.go | 4 ++-- sqlc.yaml | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/database/models.go b/database/models.go index 6cb7d15..25dd50e 100644 --- a/database/models.go +++ b/database/models.go @@ -96,7 +96,7 @@ type Metadatum struct { type User struct { ID string `json:"id"` Pass *string `json:"-"` - AuthHash string `json:"auth_hash"` + AuthHash *string `json:"auth_hash"` Admin bool `json:"-"` TimeOffset *string `json:"time_offset"` CreatedAt string `json:"created_at"` diff --git a/database/query.sql.go b/database/query.sql.go index edeb6fc..37f4cb4 100644 --- a/database/query.sql.go +++ b/database/query.sql.go @@ -121,7 +121,7 @@ ON CONFLICT DO NOTHING type CreateUserParams struct { ID string `json:"id"` Pass *string `json:"-"` - AuthHash string `json:"auth_hash"` + AuthHash *string `json:"auth_hash"` } func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (int64, error) { @@ -1225,7 +1225,7 @@ RETURNING id, pass, auth_hash, admin, time_offset, created_at type UpdateUserParams struct { Password *string `json:"-"` - AuthHash string `json:"auth_hash"` + AuthHash *string `json:"auth_hash"` TimeOffset *string `json:"time_offset"` UserID string `json:"user_id"` } diff --git a/sqlc.yaml b/sqlc.yaml index 82de80c..b98198e 100644 --- a/sqlc.yaml +++ b/sqlc.yaml @@ -123,6 +123,10 @@ sql: go_type: type: "string" pointer: true + - column: "users.auth_hash" + go_type: + type: "string" + pointer: true # Override Time - db_type: "DATETIME"