484979ad53
Rust/Axum REST API (herbapi-api) with PostgreSQL, S3/Garage, OIDC auth. Dioxus 0.7 WASM frontend (herbapi-ui) with sidebar layout and botanical reference style. 9 SQL migrations covering families, species, cultivars, suppliers, companions, images, users, API tokens.
14 lines
410 B
SQL
14 lines
410 B
SQL
CREATE TABLE images (
|
|
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
entity_type TEXT NOT NULL,
|
|
entity_id UUID NOT NULL,
|
|
s3_key TEXT NOT NULL,
|
|
caption TEXT,
|
|
source_url TEXT,
|
|
license TEXT,
|
|
is_primary BOOLEAN NOT NULL DEFAULT FALSE,
|
|
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
|
);
|
|
|
|
CREATE INDEX idx_images_entity ON images(entity_type, entity_id);
|