[IMP] Change sql constrain

Merged Jose Luis Zanotti requested to merge LR-130 into 12.0

Closes LR-130

Merge request reports