Redesign master database migration