Etcher.Annotation (etcher v0.1.0)

Copy Markdown View Source

Ecto schema for the bundled etcher_annotations table.

Used by Etcher.Storage.Default. Consumers who implement their own Etcher.Storage adapter against a custom table can ignore this schema entirely.

Fields

  • :uuid — UUIDv7 primary key
  • :target_type — string identifying the kind of resource the annotation is on (e.g. "file", "document", "product")
  • :target_uuid — UUID of the resource
  • :creator_uuid — UUID of the user who drew it (nullable)
  • :kind"rectangle" | "circle" | "polygon" | "freehand"

  • :geometry — JSONB; shape-specific coordinates in image pixels
    • rectangle: %{"x" => x, "y" => y, "w" => w, "h" => h}
    • circle: %{"cx" => cx, "cy" => cy, "r" => r}
    • polygon: %{"points" => [[x1, y1], [x2, y2], ...]}
    • freehand: %{"points" => [[x1, y1], [x2, y2], ...]}
  • :style — JSONB; optional stroke color / line width
  • :metadata — JSONB; consumer-defined extension point (link to external systems, tags, etc.)
  • :position — integer; ordering on the same target
  • :inserted_at / :updated_at — timestamps