Skip to content

Add migrations for annotate projects #5280

Closed
@jisantuc

Description

These are largely solved in the ADR with a minor edit (tms -> tiles, since we don't know that they'll be TMS tiles).

Things to consider:

  • creating a join table for annotation_labels <-> annotation_label_classes, since we can't enforce foreign key constraints on elements of an array?
  • sensible indices?
  • adding references foo(id) in all the appropriate places
  • tiles should be a table
CREATE TYPE public.annotation_project_type AS ENUM (
    'DETECTION',
    'CLASSIFICATION',
    'SEGMENTATION'
);

CREATE TABLE public.annotation_projects (
    id uuid primary key,
    created_at timestamp without time zone NOT NULL,
    created_by character varying(255) NOT NULL references users(id),
    name text NOT NULL,
    project_type public.annotation_project_type NOT NULL,
    task_size_meters integer NOT NULL,
    aoi public.geometry(Geometry,3857),
    organization_id uuid NOT NULL,
    labelers_team_id uuid NOT NULL,
    validators_team_id uuid NOT NULL,
    project uuid references projects(id)
);

CREATE TABLE public.tiles(
  ...
);

CREATE TABLE public.annotation_label_class_groups (
    id uuid primary key,
    name text NOT NULL,
    annotation_project_id uuid NOT NULL,
    order int default 0 NOT NULL
);

CREATE TABLE public.annotation_label_classes (
    id uuid primary key,
    name text NOT NULL,
    annotation_label_group_id uuid NOT NULL,
    color_hex_code text NOT NULL,
    is_default boolean default false,
    is_determinant boolean default false,
    order int default 0
);

CREATE TABLE public.annotation_labels (
    id uuid primary key,
    created_at timestamp without time zone NOT NULL,
    created_by character varying(255) NOT NULL references users(id),
    label_class uuid[] NOT NULL,
    annotation_project_id uuid NOT NULL,
    annotation_task_id uuid NOT NULL,
    geometry public.geometry(Geometry,3857)
);

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions