I basically want to convert a table from mysql to sqlite with the following scheme:
create table items (
id integer auto_increment,
version integer default 0,
primary key (id, version)
);
Essentially, I want ID to auto increment whenever I insert anything into the table, with VERSION starting off at 0, but still allow multiple items with the same ID as long as VERSION is different.
I'm trying to replicate this behavior with Sqlite however, I can't seem to get table creation working. It seems like you are only allowed one column as autoincrement and it has to be the primary key. If I make ID the primary key, then I can't use VERSION as part of the key. However, if I make a multi-column key (ID, VERSION) , then I can't get ID to auto increment.
Is there a workaround or perhaps a better way of designing my table?