Retroactively fix some SQL schema problems

I originally wasn't going to do passwords, but after struggling with
webauthn I decided I'd just go for it. It simplifies the code a lot if I
assert that I always have a password, displayname, etc.
This commit is contained in:
Eli Ribble 2025-11-05 17:36:32 +00:00
parent 981f043b7f
commit 4d55a391c9
No known key found for this signature in database
12 changed files with 179 additions and 243 deletions

View file

@ -28,12 +28,12 @@ func formatQuery(s string) (string, error) {
var defaultFaker = faker.New()
func random_enums_ArcgisLicenseType(f *faker.Faker, limits ...string) enums.ArcgisLicenseType {
func random_enums_Arcgislicensetype(f *faker.Faker, limits ...string) enums.Arcgislicensetype {
if f == nil {
f = &defaultFaker
}
var e enums.ArcgisLicenseType
var e enums.Arcgislicensetype
all := e.All()
return all[f.IntBetween(0, len(all)-1)]
}

View file

@ -72,16 +72,16 @@ func UserByUsername(Username string) *UserByUsernameQuery {
type UserByUsernameRow = struct {
ID int32 `db:"id"`
ArcgisAccessToken null.Val[string] `db:"arcgis_access_token"`
ArcgisLicense null.Val[enums.ArcgisLicenseType] `db:"arcgis_license"`
ArcgisLicense null.Val[enums.Arcgislicensetype] `db:"arcgis_license"`
ArcgisRefreshToken null.Val[string] `db:"arcgis_refresh_token"`
ArcgisRefreshTokenExpires null.Val[time.Time] `db:"arcgis_refresh_token_expires"`
ArcgisRole null.Val[string] `db:"arcgis_role"`
DisplayName null.Val[string] `db:"display_name"`
DisplayName string `db:"display_name"`
Email null.Val[string] `db:"email"`
OrganizationID null.Val[int32] `db:"organization_id"`
Username string `db:"username"`
PasswordHashType null.Val[enums.Hashtype] `db:"password_hash_type"`
PasswordHash null.Val[string] `db:"password_hash"`
PasswordHashType enums.Hashtype `db:"password_hash_type"`
PasswordHash string `db:"password_hash"`
}
type userByUsernameTransformer = bob.SliceTransformer[UserByUsernameRow, []UserByUsernameRow]