Fix migration for relations