Check table contraints

Function used by database code events table constraints.