CivicSpleen / ambry

A comprehensive data package manager
BSD 2-Clause "Simplified" License
4 stars 5 forks source link

Remove or augment numeric id on config database record #97

Closed ericbusboom closed 9 years ago

ericbusboom commented 9 years ago

The Config table has an integer primary key, which unfortunately doesn't work with the Ambry database model because all of the records for a dataset can be stored in a bundle, and then loaded into another library, with the likely result that the integer primary keys from two bundles will conflict.

This is why nearly all of the other tables have vid keys or compound keys.

Alter the config table to use a primary key that is only unique within a dataset.

One possibility: make it a compound primary key, with the d_vid being the other part of the key. This should only require the change of using d_vid along with id when looking for parent records.

nmb10 commented 9 years ago

Use next_sequence_id() and identity.GeneralNumber1 with a type code of ‘F’ to populate id field. See orm.dataset.Dataset.new_source() for an example of using the two together.