Usually, something that has multiple versions could be in an autoincrement field as the primary key. Then, in a JSONB field with GIN index (since you’re using PostgreSQL), you would have a dict of each version, like this:
{
“1”: { # beginning of article 1
“versions”: {
“1”: {
“title”: “Blah1”,
“timestamp”: 172903740.0002782,
“alt”: “Super text”
}, # end of version 1
“2”: {
“title”: “Blah1”,
“timestamp”: 1729375394.0002782,
“alt”: “Super text blah”
}, # end of version 2
“3”: {
“title”: “Blah2”,
“timestamp”: 17290826300.0002782,
“alt”: “Super text blah”
} # end of version 3
} # end of versions attribute/column
}, # end of article 1
“2”: {
“versions”: {
“1”: {
“title”: “Blah1”,
“timestamp”: 172903740.0002782,
“alt”: “Super text”
}, # end of version 1
“2”: {
“title”: “Blah1”,
“timestamp”: 172903740.0002782,
“alt”: “Super text blah”
} # end of version 2
} # end of article 2
} # end of queryset
So your primary key is a BigAutoField and your “versions” attribute/column is a JSONField. IF YOU ARE FILTERING BASED ON ARTICLE TITLE, make sure you put a GIN Index on that JSONField.