I would like to add an autoincrementing integer field called uid
to an existing table assoc
, but it doesn't look like I can do that unless it's a primary key.
I have fields local_id
and remote_id
which are the existing primary key pair, and I do that so that I can INSERT OR IGNORE INTO assoc
so that I don't get duplicate primary keys, but if I have a pair of columns as a primary key, I can't seem to use them as an update (see other SO question).
Could anyone suggest how to restructure the table (and implement that restructuring using ALTER TABLE
) so that I can get the behavior I need:
- a single autoincrementing key, so I can use that for
UPDATE
s - a pair of fields
local_id
andremote_id
so that the pair(local_id, remote_id)
remains unique in the table