added relationships tabel and migrated it to the DB with indexes