chore: Refactor sg migration
Created by: efritz
Pulled from #29831. Should be behavior-preserving.
- Collapsed
squash
andmigration
packages - Renamed
Run
->Squash
andRunAdd
->Add
for consistency - Unexported util functions
- Moved shared functions into util package
- Reorder code blocks by use