Updated migration files to work with pivot tables