added database fk constraints, dropped unused table [Finishes #83038750]