OBJECTIDs Primary Keys, and Documents for geodb best practices
I am now on to making many to many relationship classes because a patch of Weeds can have many species and a species can belong to many patches. I have a little test UML diagram where I try out the concepts for a simple schema. I try to create a Many to Many between a table and a polygon featureclass. I can’t get the relationship class to understand if I specify the objectid as the primary key and the polygonid (integer) as the foreign key. If I change it to some arbitrary text field for both PK and FK it works fine.
Then I do some searches on support and find this gem of a thread, which basically states never use OBJECTID field as a PK because when you export the featureclass all the items may renumber themselves. WTF? Which may lead to a much larger philosophical problem. How do I autogenerate primary keys? Can I use autogenerated OIDS as long as they are not in the ObjectID field? Oh wait – you can not have more than one OID field in featureclass. So it looks like there is no way to get an autogenerated column in a geodb without writing code. This has to be wrong. Please for the love of all that is right in the world of data consistency let this be wrong!
Where is this written? Where would I even begin to look for this. It would be nice to know these things before you actually design a geodb and have it in production.