Return 0 for foreign key when related table has not been created

Null was causing issues with 'not null' foreign keys