You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A new batch schema whose name uses its parent's lot number fails to create #271
Creating a parent schema and a batch schema in one revision fails if the batch's name template uses the parent's lot number.
Example
Cell Line is a parent schema.
Cell Line Batch has a Parent Cell Line field, a parent link to Cell Line. Its names are built from the parent and the lot number, like CL001-1.
Both schemas are new in the same revision. upgrade creates them, then stops at the name template:
Field parent_cell_line is not a parent link field. The field for type
CHILD_ENTITY_LOT_NUMBER must be a parent link field.
Why
A link field can't point at a schema that doesn't exist yet, so Liminal creates Parent Cell Line as a blank link and fills in the target later. The generated revision runs these steps:
Create Cell Line.
Create Cell Line Batch, with Parent Cell Line as a blank link.
Set Cell Line Batch's name template to Parent Cell Line plus the lot number. This fails. A lot number needs a parent link, and Parent Cell Line is still blank.
Set Cell Line Batch's naming strategy to use the template.
Point Parent Cell Line at Cell Line.
Two things are wrong:
Step 5 should come before step 3. Liminal sorts steps by type, and name templates always sort ahead of field updates.
Step 5 leaves out parent_link. It sets the target but not parent_link=True. So even in the right order, Parent Cell Line would be an ordinary link, not a parent link, and step 3 would still fail.
Steps 1 and 2 have already applied when it fails, and the remote revision doesn't move.
Workaround. We edited the revision to run step 5 first, with parent_link=True added, then steps 3 and 4.
Suggested fix. For newly created schemas, set parent_link along with the link target, and run the name template and naming strategy after the link targets. Revisions that only update existing schemas would keep today's order.
Happy to open a PR with tests. Seen on 5.1.1, with #262 applied.
I've opened #272 with a fix. For new schemas, it sets the parent link first, then the name template and naming strategy, and the link step now carries parent_link. Revisions that only touch existing schemas come out the same as before.
We tried it on our tenant with a Cell Line and Cell Line Batch pair like the example above, and it applied cleanly and rolled back cleanly.
This fixes the new-schema case, but there could be other ordering cases. Happy to take a shot at a general ordering fix if you'd like.
Hey! I went ahead and built on top of the PR you created to cover the remaining NameTemplate ordering conflicts that can arise. I will do some last testing and then merge this in with the next Liminal release! #276
Activity
mghent commentedon Oct 29, 2026
I've opened #272 with a fix. For new schemas, it sets the parent link first, then the name template and naming strategy, and the link step now carries
parent_link. Revisions that only touch existing schemas come out the same as before.We tried it on our tenant with a Cell Line and Cell Line Batch pair like the example above, and it applied cleanly and rolled back cleanly.
This fixes the new-schema case, but there could be other ordering cases. Happy to take a shot at a general ordering fix if you'd like.
ndamania00 commentedon Nov 4, 2026
Hey! I went ahead and built on top of the PR you created to cover the remaining NameTemplate ordering conflicts that can arise. I will do some last testing and then merge this in with the next Liminal release! #276
Fix update name template ordering (dynotx#276)