Small db fix

* the foreign key definitions were missing the ON DELETE and ON UPDATE
constraints