Reposting this (with some formatting changes) from the bugs and feedback thread:
Unhappiness from barracks under certain civics strongly encourages players to demolish, given how easy barracks is to build later if one wants to, which is sort of exploit-y, as was previously mentioned, because the AI can't do it.
What I personally would do is make barracks (and other military experience buildings) simply have no effect under pacifism instead of causing unhappiness,
and instead of +1 unhappy for barracks under bourgeois, +1 unhappy from war weariness (or increased war weariness itself).
Unhappiness from barracks under certain civics strongly encourages players to demolish, given how easy barracks is to build later if one wants to, which is sort of exploit-y, as was previously mentioned, because the AI can't do it.
What I personally would do is make barracks (and other military experience buildings) simply have no effect under pacifism instead of causing unhappiness,
and instead of +1 unhappy for barracks under bourgeois, +1 unhappy from war weariness (or increased war weariness itself).