Women who work rotating night shifts and also have unhealthy lifestyle habits may be much more likely to develop diabetes than peers with only one of these risk factors, according a large study.

In the study of female nurses, every five years of working a mix of night and daytime shifts was associated with a 31 percent increase in risk of developing diabetes. Each of four unhealthy habits – drinking, smoking, failing to exercise and eating poorly – was associated with a more than doubled diabetes risk.

Working at night and sleeping during the day can impair the body’s production of melatonin, which may in turn compromise the body’s ability to use the hormone insulin to control blood sugar, Gilbert-Ouimet, who wasn’t involved in the study, said by email. High blood sugar can lead to diabetes.

“If we add unhealthy behaviors to the equation, an amplification of the risk can be expected considering the increased vulnerability of these workers,” Gilbert-Ouimet said.