Fix dependencies in migrations