mirror of https://github.com/coder/coder.git
dbgen consistency
This commit is contained in:
parent
8260082688
commit
9c5c1f7e12
|
@ -396,11 +396,14 @@ func ProvisionerJob(t testing.TB, db database.Store, ps pubsub.Pubsub, orig data
|
|||
orig.Tags[jobID.String()] = "true"
|
||||
}
|
||||
|
||||
// Attempt to alloc to the default org if exists
|
||||
defaultOrg, _ := db.GetDefaultOrganization(genCtx)
|
||||
|
||||
job, err := db.InsertProvisionerJob(genCtx, database.InsertProvisionerJobParams{
|
||||
ID: jobID,
|
||||
CreatedAt: takeFirst(orig.CreatedAt, dbtime.Now()),
|
||||
UpdatedAt: takeFirst(orig.UpdatedAt, dbtime.Now()),
|
||||
OrganizationID: takeFirst(orig.OrganizationID, uuid.New()),
|
||||
OrganizationID: takeFirst(orig.OrganizationID, defaultOrg.ID, uuid.New()),
|
||||
InitiatorID: takeFirst(orig.InitiatorID, uuid.New()),
|
||||
Provisioner: takeFirst(orig.Provisioner, database.ProvisionerTypeEcho),
|
||||
StorageMethod: takeFirst(orig.StorageMethod, database.ProvisionerStorageMethodFile),
|
||||
|
|
|
@ -20,7 +20,7 @@ WHERE
|
|||
WHERE
|
||||
nested.started_at IS NULL
|
||||
-- Enforce hard organization boundary.
|
||||
AND nested.organization_id = @organization_id
|
||||
AND nested.organization_id = @organization_id
|
||||
-- Ensure the caller has the correct provisioner.
|
||||
AND nested.provisioner = ANY(@types :: provisioner_type [ ])
|
||||
AND CASE
|
||||
|
|
Loading…
Reference in New Issue