Fixed contraints in db creation