-- V1 — initial schema. Item domain only; user/auth tables arrive in later
-- migrations (forward-only policy). All timestamps are timestamptz (UTC).

CREATE TABLE items (
    id          uuid         NOT NULL,
    name        varchar(150) NOT NULL,
    description text,
    created_at  timestamptz  NOT NULL,
    updated_at  timestamptz  NOT NULL,
    version     bigint       NOT NULL,
    CONSTRAINT pk_items PRIMARY KEY (id)
);

-- Case-insensitive uniqueness on name (§4).
CREATE UNIQUE INDEX ux_items_name_lower ON items (lower(name));
