I'm trying to create a column that represents a unique record ID, and can't seem to figure out how to create it. I'm using CoreData on iOS 9.x with a SQLite backing store.
The simple scenario is a table which should only have a single record which represents the last stored game number for each of several different game levels. I want to ensure that there is only one record in this table so that I can query the proper column for the last game number of that game type or level.
The idea being a single record that would have columns such as:
- Last Easy Game Number Played
- Last Hard Game Number Played, etc.
The game type/level, game number is then an indexed value in the game level preset values table. In this way I can query the last game number, search for a value greater than that, or else wrap around to game number 1 of that level to start the game.
The ability to create a unique index or primary key is beyond my mental grasp, (or use the record UUID saved by SQLite) but I know it is in either the index creation or the constraint creation. Yet I've queried the forum and the documentation for anything on creating either of these and don't see it. This surprises me - that it's not in the documentation - but the fact that it's not in the forum tells me it's something obvious that I'm not seeing.
Can anyone give me a clue on this, please?
Thanks very much in advance!