Files
rbv/migrations/0005_persons.sql
rob thijssen a27d636b88 Initial commit: rbv workspace with ingest, API, UI, and ML client
Rust workspace with crates for entity types, hashing, database access,
ML client (immich-ml compatible), ingest pipeline, clustering, auth,
search, CLI, and axum API server. Vite/React UI. SQL migrations.
Includes retry/backoff on transient ML API connection errors.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 16:51:50 +02:00

17 lines
592 B
SQL

CREATE TABLE persons (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE TABLE person_names (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
person_id UUID NOT NULL REFERENCES persons(id) ON DELETE CASCADE,
name TEXT NOT NULL,
is_primary BOOLEAN NOT NULL DEFAULT false,
CONSTRAINT name_format CHECK (name ~ '^[a-z][a-z\-]*[a-z]$'),
UNIQUE (name)
);
CREATE INDEX idx_pn_person ON person_names(person_id);
CREATE INDEX idx_pn_name ON person_names(name);