Democrats and the White House struck a deal to avert a partial government shutdown as they negotiate new immigration enforcement restrictions.