relations in models, some fixes in migrations