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
fix: getMetadata shares inherited metadata by reference, so subclass decorators write into the parent and sibling tables #43
getMetadata stores the parent's metadata object itself on a subclass (src/common.ts, the inherited branch of getMetadata), not a copy. A decorator on a subclass therefore writes into the parent's metadata and into every sibling's, which breaks the inheritance pattern documented in docs/2.table-definitions.md ("Inheritance").
Reproduction (CommonJS, against the built package; identical on main and on #42):
Expected: Users keeps tableName=users and fields createdBy,email; Posts keeps posts and createdBy,title; Base keeps only createdBy.
The same sharing affects ModifiersStaticMetadata (@Hashed on a child's field adds it to the parent's modified fields) and @Fixture (a sibling's generator becomes every sibling's generator, so insertAllFixtureData calls Posts' generator with Users).
Fixed by #54 (copy the metadata a subclass inherits instead of sharing it), landed on main (921bf9d, the landed campaign/integration PR #87). Checked on main: a Base with two subclasses now gives [createdBy], [createdBy,email], [createdBy,title]; the 243 module tests pass.
Activity
feat(database-decorators): accept any property key in the modifier me…
Upd4ting commentedon Nov 4, 2026
Fixed by #54 (copy the metadata a subclass inherits instead of sharing it), landed on main (921bf9d, the landed campaign/integration PR #87). Checked on main: a Base with two subclasses now gives [createdBy], [createdBy,email], [createdBy,title]; the 243 module tests pass.