mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
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:
@@ -1363,7 +1363,7 @@ func (q *sqlQuerier) GetLicenses(ctx context.Context) ([]License, error) {
|
||||
&i.UploadedAt,
|
||||
&i.JWT,
|
||||
&i.Exp,
|
||||
&i.Uuid,
|
||||
&i.UUID,
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -1399,7 +1399,7 @@ func (q *sqlQuerier) GetUnexpiredLicenses(ctx context.Context) ([]License, error
|
||||
&i.UploadedAt,
|
||||
&i.JWT,
|
||||
&i.Exp,
|
||||
&i.Uuid,
|
||||
&i.UUID,
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -1427,10 +1427,10 @@ VALUES
|
||||
`
|
||||
|
||||
type InsertLicenseParams struct {
|
||||
UploadedAt time.Time `db:"uploaded_at" json:"uploaded_at"`
|
||||
JWT string `db:"jwt" json:"jwt"`
|
||||
Exp time.Time `db:"exp" json:"exp"`
|
||||
Uuid uuid.NullUUID `db:"uuid" json:"uuid"`
|
||||
UploadedAt time.Time `db:"uploaded_at" json:"uploaded_at"`
|
||||
JWT string `db:"jwt" json:"jwt"`
|
||||
Exp time.Time `db:"exp" json:"exp"`
|
||||
UUID uuid.UUID `db:"uuid" json:"uuid"`
|
||||
}
|
||||
|
||||
func (q *sqlQuerier) InsertLicense(ctx context.Context, arg InsertLicenseParams) (License, error) {
|
||||
@@ -1438,7 +1438,7 @@ func (q *sqlQuerier) InsertLicense(ctx context.Context, arg InsertLicenseParams)
|
||||
arg.UploadedAt,
|
||||
arg.JWT,
|
||||
arg.Exp,
|
||||
arg.Uuid,
|
||||
arg.UUID,
|
||||
)
|
||||
var i License
|
||||
err := row.Scan(
|
||||
@@ -1446,7 +1446,7 @@ func (q *sqlQuerier) InsertLicense(ctx context.Context, arg InsertLicenseParams)
|
||||
&i.UploadedAt,
|
||||
&i.JWT,
|
||||
&i.Exp,
|
||||
&i.Uuid,
|
||||
&i.UUID,
|
||||
)
|
||||
return i, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user