error in orm wrong constraint