[WIP] fixes to migrations and projects queries