Added indexes to foregin keys, tweaked migration scripts to sync tables with model relationships