-- Gallery posts for photo news section
CREATE TABLE IF NOT EXISTS gallery_posts (
    uuid         UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    title        TEXT NOT NULL,
    content      TEXT,
    image_urls   TEXT[],
    is_published BOOLEAN NOT NULL DEFAULT TRUE,
    published_at TIMESTAMP,
    created_at   TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_at   TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

CREATE INDEX IF NOT EXISTS idx_gallery_published ON gallery_posts(published_at DESC NULLS LAST);
CREATE INDEX IF NOT EXISTS idx_gallery_published_flag ON gallery_posts(is_published);
