There has been quite an extensive discussion on this semi-recently. Probably more than you need to know: Test: Soft vs Hard sum-to-zero constrain + choosing the right prior for soft constrain
TLDR: either use sum(x) ~ normal(0, <small_number> * <num_lements>)
or the code in this answer in the aformentioned thread + the one below (which is in my experience slightly superior). For more details read the whole topic.