We are modifying our post on stackoverflow.
And we only changed the tags part,removed tag1
,tag2
and added tag3
,tag4
.
After pressing the Post Your Question button,these things should be done:
- reduced the
count
column fortag1
,tag2
by 1 - delete the relation between the post and
tag1
,tag2
- if
tag3
,tag4
already exists,increase thecount
column of the two by 1;otherwise,insert them to thetags
table withcount
value 1 - add the relation between the post and
tag3
,tag4
Let's take a deep breath and that's all!
I want to see which ORM can approach this most easily/performant no matter it's written in PHP/Java/C/.Net or any language else,because the ideas are similar across languages!