misc sql and migration fix
[#48859859] Update data model to support granular tracking of primaries by party