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>
19 lines
614 B
SQL
19 lines
614 B
SQL
CREATE TABLE images (
|
|
id BYTEA PRIMARY KEY,
|
|
width INT,
|
|
height INT,
|
|
indexed_at TIMESTAMPTZ NOT NULL DEFAULT now()
|
|
);
|
|
|
|
CREATE TABLE gallery_images (
|
|
gallery_id BYTEA NOT NULL REFERENCES galleries(id) ON DELETE CASCADE,
|
|
image_id BYTEA NOT NULL REFERENCES images(id) ON DELETE CASCADE,
|
|
filename TEXT NOT NULL,
|
|
ordering INT NOT NULL DEFAULT 0,
|
|
PRIMARY KEY (gallery_id, image_id),
|
|
UNIQUE (gallery_id, filename)
|
|
);
|
|
|
|
CREATE INDEX idx_gi_gallery ON gallery_images(gallery_id);
|
|
CREATE INDEX idx_gi_image ON gallery_images(image_id);
|