A state ballot measure to spell out how much room egg-laying chickens, calves raised for veal and breeding pigs should be given in California won Tuesday.

Proposition 12 will require that all egg-laying hens have at least 1 square foot of usable floor space by the end of 2019 and be cage free with accommodations such as scratching posts, nests and perches by the end of 2021. Calves raised for veal would need 43 square feet of usable floor space, while breeding pigs would have to be given 24 square feet in order for their meat to be sold in the state.

The initiative was proposed by the Service Employees International Union-United Healthcare Workers West and drew fierce opposition from for-profit dialysis providers. Dialysis clinics provide treatment for people without functioning kidneys.

Those dialysis companies contributed $111 million to defeat the measure, the most one side of a ballot initiative has spent in any state in 16 years. Two committees run by the union raised $20 million in support of Prop. 8. All told, it was the most expensive initiative in state history.

Proposition 5: Voters also rejected a ballot measure that would have allowed people 55 and older as well as those who are severely disabled or disaster victims to, when selling their primary residence, transfer its property tax assessment to their next home. That would have let them avoid a potentially steep increase in taxes.

Backed by the state’s largest private ambulance operator, American Medical Response, Prop. 11 was intended to head off a potential lawsuit. A 2016 court decision related to security guards not having to be on call during their meal breaks prompted the company’s concern that ambulance workers would seek the same protections.