-
MODX Staff
- 10,725 Posts
Definitely should not need to set it, though it will not use this primary key when being installed if unique_key is specified and/or preserve_keys is false.
-
☆ A M B ☆
- 2,475 Posts
Thank you Jason -- gonna update the docs....
-
MODX Staff
- 10,725 Posts
In some cases, it may be used to key related objects stored along with it, and though it will not be preserved when inserted (unless preserve_keys == true), it is important in the representation of the relationship.
-
☆ A M B ☆
- 2,475 Posts
So is it like the hard-coded id is a placeholder of some kind? So if your build script might hard-code ids 1-10 to preserve relationships with related objects, but when they actually get inserted, they may end up with ids 53 to 62 or something?
-
MODX Staff
- 10,725 Posts
Correct. When you package related objects together in a single vehicle and set the attribute for preserve_keys to false (or define a unique_key that does not include the primary key), they preserve their foreign key relationships and resolve those FK column values when being installed.