Fix migration dependencies (issue #310)