[okfn-help] vdm: primary keys question
rufus.pollock at okfn.org
Mon Aug 16 14:55:52 BST 2010
On 16 August 2010 12:39, Martijn Faassen <faassen at startifact.com> wrote:
> Hi there,
> [primary key handling]
> Thanks for that information.
> I see in the demo code that you use make_table_stateful on the tables,
> which adds a column
> 'state' to what I understand to be the main table (not the revision table).
Yes, it gets added to the revision table because the revision table
copies the 'continuity' table (which now has a state column).
> What is this doing? Presumably it can't lead to the situation where I
> have two records with the
> same id but in a different state. Is this in practice only used to
> track the deleted state?
This is used indeed to track the deleted state (though also pending:
you could have an object that is created but not yet displayed pending
approval by someone). You could also use 'pending' on object
*revisions* to have several revisions to the same object (so same
object_id, but different revision ids) each in a pending state.
(Of course, the danger of queuing up pending revisions is you don't
know if they contradict each other ...)
More information about the okfn-help