added db constraints