added database initialization event
fixed empty relationships for null foreign keys