Skip to content

docs: Document the tail field option for inherited models#699

Open
marcelomendoncasoares wants to merge 2 commits into
serverpod:mainfrom
marcelomendoncasoares:docs/model-tail
Open

docs: Document the tail field option for inherited models#699
marcelomendoncasoares wants to merge 2 commits into
serverpod:mainfrom
marcelomendoncasoares:docs/model-tail

Conversation

@marcelomendoncasoares

@marcelomendoncasoares marcelomendoncasoares commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

Model fields can now be marked with tail so they are ordered after every normal field of an inheritance hierarchy. This is what keeps audit fields like createdAt and updatedAt at the end of a generated class instead of in front of the child's own fields. Neither the inheritance page nor the model reference mentioned it.

Changes

  • Add an "Ordering inherited fields" section to the inheritance and polymorphism page.
  • Show the field-level tail syntax and how it combines with other field options.
  • Walk through a three-level hierarchy and list the resulting field order.
  • State that child tail fields come before parent tail fields, that the order applies to constructors, serialization, and table definitions, and that tail cannot be used on id.
  • Clarify that tail affects generated code only and does not produce a column-reordering migration.
  • Add the tail (fields) row to the model reference table.

Reference

Use a noun-shaped heading consistent with the neighbouring sections, give
the example hierarchy names that read naturally, and state the motivation
for the keyword before the syntax.
@marcelomendoncasoares
marcelomendoncasoares marked this pull request as ready for review July 21, 2026 18:51
@marcelomendoncasoares
marcelomendoncasoares requested a review from a team July 21, 2026 18:51
@marcelomendoncasoares
marcelomendoncasoares marked this pull request as draft July 21, 2026 18:52
@marcelomendoncasoares
marcelomendoncasoares marked this pull request as ready for review July 21, 2026 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant