Decoratorapproach it is easy to
extendbasic columns to an abstract class and simply extend this. For example, your
updatedAtcolumns may be defined in such a
BaseEntity. For more details, see the documentation on concrete table inheritance.
EntitySchemaapproach, this is not possible. However, you can use the
...) to your advantage.
Categoryexample from above. You may want to
extractbasic column descriptions and reuse it across your other schemas. This may be done in the following way:
BaseColumnSchemaPartin your other schema models, like this:
extendedcolumns also to the
Categoryinterface (e.g., via
export interface Category extend BaseEntity).
Categoryexample (with its
CategoryEntityschema in order to get some data or manipulate the database.