Documentation
¶
Overview ¶
Package entmixin provides reusable Ent schema mixins for the ncps Ent schemas under ent/schema/.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Timestamps ¶
Timestamps contributes the project-standard `created_at` and `updated_at` columns to any Ent schema that embeds it via `Mixin()`.
- `created_at` is NOT NULL with DB-level DEFAULT CURRENT_TIMESTAMP, set on insert and never modified afterwards (immutable).
- `updated_at` is nullable; the application sets it explicitly when a row is modified.
The DB-level DEFAULT on `created_at` is declared via `entsql.Default` so that raw-SQL inserts (notably from migration backfills and test helpers) succeed without specifying the column.
func (Timestamps) Annotations ¶
func (Timestamps) Annotations() []schema.Annotation
Annotations is required for the mixin interface; no schema-wide annotations are needed here because the per-field annotations above are what the dialect codegen reads.
Click to show internal directories.
Click to hide internal directories.