migrates database