Add migration for content group type and improve migration for publishing mode
The DB index now filters by non-existing publishingMode instead of published flag. After recent changes to the migration, the published flag still exists after running the migration, so filtering by it does not do anything.
Also fixed variable naming.