functional report parsing & little db changes

added optional foreign keys