batches: add limit to subquery for updating `batch_specs.batch_change_id`
Created by: BolajiOlajide
Thanks, @courier-new for reporting this.
It's possible (in your dev environment) for a batch_spec
to be associated with more than one batch_change
, this results in an error when running the migration added by #38921.
Adding a limit to the subquery that fetches the batch_change
associated with a batch_spec
solves this and also gives the added advantage of having a faster execution time as we end the search once we find a match.
Before | After |
---|---|
Test plan
Manually verified migrations run locally.