Validation logic should probably not be in the db-code