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>
17 lines
592 B
SQL
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);
|