Added NOT NULL to foreign keys
Added dependencies according to documentation