Which seems to work sometimes. The issue I’ve run into however is with multiple items. The parent table gets filled correctly but the child table does not.
So here’s the scenario:
I have 4 items, each with several child items inserted into slots. During the previewing of the DB template on each item, everything looks good. If I preview the content list, it looks good, if I preview the content list and the individual items, it looks good.
If I run my DB publish edition on the individual items (i.e. item one with child items only), it publishes out fine. However, when all items are in public state and I run the DB publishing to publish all, the parent items all publish, but not all the child items are publishing out. I hope that makes sense.
p.s. I posted this question in one of the above threads as well but didn’t receive any response, just thought maybe no one seen it, sorry for the duplicates. If this thread as the response then I’ll put that in the above thread.
Oh I just discovered, this only seems to do it with child items that are used by different parent items. So example I have Parent One that uses 3 child items (in the slot), I have parent two that uses the same 3 child items in its slot.
Looks like the last one published, gets the childern.
Sam is absolutely correct.
It seems like your child_id is set as primary key, however it is not and as such is being overwritten by the last item published with this id.
Set your keys to be unique as parent_id, child_id
That would make sense. I tried using the SEQ column referred to in the implementation guide with $rx.db.sequence(0,1) but of course it creates the same sequence for each parent, so only the last one is published, so that makes sense to me.