dbgen consistency

This commit is contained in:
Steven Masley 2024-03-04 10:50:15 -06:00
parent 8260082688
commit 9c5c1f7e12
2 changed files with 5 additions and 2 deletions

View File

@ -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),

View File

@ -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