Fixed migration errors
Improvements to 038 migration (issue history rebuild).

- using bulk inserts
- removed excessive selects
- using eager assosiations load to minimize query count
Merged v32_migration_performance branch to master again