Add constraints to tables