Migration script is finally fully working