feat(annotations): add polygon JSONB support for quadrilateral shapes
- V23 migration adds polygon JSONB column with 4-point CHECK constraint - PolygonConverter: AttributeConverter for List<List<Double>> <-> JSONB - @UniquePoints custom validator rejects duplicate coordinates - CreateAnnotationDTO: validated optional polygon field - DocumentAnnotation entity: polygon field with converter Refs #227 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
-- Add optional polygon field for quadrilateral annotation shapes (Kraken OCR output).
|
||||
-- See ADR-002 for the design decision.
|
||||
|
||||
ALTER TABLE document_annotations ADD COLUMN polygon JSONB;
|
||||
|
||||
ALTER TABLE document_annotations
|
||||
ADD CONSTRAINT chk_annotation_polygon_quad
|
||||
CHECK (polygon IS NULL OR jsonb_array_length(polygon) = 4);
|
||||
Reference in New Issue
Block a user