fixed database constraints for create