[okfn-help] vdm: primary keys question

David Read david.read at okfn.org
Sat Aug 14 18:06:40 BST 2010


The short answer: an object's id stays the same, but each revision has
a different 'revision id'.

The long answer: Let's take an example: we have made 'package' objects
revisioned. We have updated a particular 'package' a couple of times:

* The package has a primary key 'id' that stays the same.

* In the package_revision table storing the 'old versions' of the
package, there is a dual primary key of 'id' and 'revision_id'. Each
of the updates is a row with has am 'id' that is the same value as for
the package 'id', so stays constant, whilst the 'revision_id' changes.

* In the revision table, you have a new 'id' for each change, which
matches the 'revision_id' in the package_revision table.

Hope that helps,
David

On 14 August 2010 13:47, Martijn Faassen <faassen at startifact.com> wrote:
> Hi there,
>
> I'm slowly looking into vdm a bit more and I have a question:
>
> Does vdm promise primary keys to be stable over revisions, or does the
> primary key change? That is, if I create revision 1 of a record, and
> then I create a new revision 2 of that record, is the record in rev 1
> guaranteed to have the same primary key as the record in rev2?
>
> Regards,
>
> Martijn
>
> _______________________________________________
> okfn-help mailing list
> okfn-help at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/okfn-help
>



More information about the okfn-help mailing list