Extract getClassName method

Make it easier to customize the migration naming schema.
Merge pull request #5510 from alprs/fix/extract-migration-classname

Extract getClassName method