Fix foreign keys and table names in new model

Change-Id: I86c5b55213098644f9c63557c976e93deacb3479