-
Notifications
You must be signed in to change notification settings - Fork 0
Custom column annotation
ArteMerlow edited this page May 28, 2025
·
1 revision
Today, we have already covered the AutoIncrementId annotation. It is a column annotation. However, you can also create your own annotations with custom behavior:
export const BooleanColumn = ColumnAnnotationFabric.create({
type: ColumnType.BOOLEAN,
notNull: true
})Or this:
export const BooleanColumn = ColumnAnnotationFabric.create(DefaultColumn.BOOLEAN)It is worth noting that if you create annotations as constants rather than functions (including arrow functions), you don't need to add parentheses when using them. However, if your annotation accepts a value (even an optional one), you must use it with parentheses after the name.