Ok, I have a table that will look something like this:
Post
˪ Id
˪ Version
˪ Title
˪ Content
The idea is that the Id and Version together will be the primary key since you can have a single post multiple times but of different versions.
My question is this: I would like to have the Id to auto increment. Is this possible in a setup like this? Will things be messed up when I insert the second version of a post for example?
Seems like I need to clear some things up here. What I would like is to do something like this:
INSERT INTO posts VALUES (NULL, 0, "A title", "Some content");
That would create a new post with some auto incremented id. Let's say it got the id 7. I now want to create a new version:
INSERT INTO posts VALUES (7, 1, "A new title", "Some adjusted content");
Would that work? or would the id still get an auto incremented value? And even if it did work, am I doing something I shouldn't from a database design point of view, et cetera?