Add foreign keys to database

Changing the referrer value for the root admin from 0 to NULL to make
the foreign key check work.

Signed-off-by: Florian Pritz <bluewind@xinu.at>