Added foreign keys and indexes