I want to store different versions of different texts and other data in a table. For the texts, my table looks like this:
id BigSerial, PRIMARY KEY
version Integer
text Text
origin BigInt
Now I want to store different versions of texts in this table like this:
1,0,"My Text, first Version",null
2,1,"My Text, second Version",1
3,0,"My 2nd Text v1",null
4,1,"My 2nd Text v2",3
I don't know yet how to query for the row with the highest version number for each set of texts.