fix broken table constraints