Adds check if table exists before trying to add the constraint