copy code from migration to create collection on index