chore: Force license uuids to not be null (#6012)

* chore: Force license uuids to not be null

* All unit tests generate uuids for licenses

* Update migration files to new numbers

* Put migration in transaction
This commit is contained in:
Steven Masley
2023-02-13 18:21:58 -06:00
committed by GitHub
parent a54de6093b
commit 733f58c76d
11 changed files with 39 additions and 25 deletions

View File

@ -645,7 +645,7 @@ func ConvertTemplateVersion(version database.TemplateVersion) TemplateVersion {
func ConvertLicense(license database.License) License {
return License{
UploadedAt: license.UploadedAt,
UUID: license.Uuid.UUID,
UUID: license.UUID,
}
}

View File

@ -71,10 +71,7 @@ func TestTelemetry(t *testing.T) {
UploadedAt: database.Now(),
JWT: "",
Exp: database.Now().Add(time.Hour),
Uuid: uuid.NullUUID{
UUID: uuid.New(),
Valid: true,
},
UUID: uuid.New(),
})
assert.NoError(t, err)
_, snapshot := collectSnapshot(t, db)