Anti-depressant meds during pregnancy

Hi! I had severe PPD after my first child. The doctor said that the risks of staying on medication during pregnancy is better than being unmedicaided for the baby. However, I know there is a risk of PPD even on medication and that really scares me! Has anyone had any experience with this? Thank you!